diff --git a/chb/app/CHVersion.py b/chb/app/CHVersion.py index 9e1ac769..2fd9f4a0 100644 --- a/chb/app/CHVersion.py +++ b/chb/app/CHVersion.py @@ -1,3 +1,3 @@ -chbversion: str = "0.3.0-20260126" +chbversion: str = "0.3.0-20260218" minimum_required_chb_version = "0.6.0_20260122" diff --git a/chb/ast/ASTCPrettyPrinter.py b/chb/ast/ASTCPrettyPrinter.py index 99430d53..ce269b67 100644 --- a/chb/ast/ASTCPrettyPrinter.py +++ b/chb/ast/ASTCPrettyPrinter.py @@ -497,7 +497,6 @@ def visit_memref(self, memref: AST.ASTMemRef) -> None: if memref.memexp.is_ast_addressof: memexpa = cast(AST.ASTAddressOf, memref.memexp) memexpa.lval.accept(self) - ''' elif memref.memexp.is_ast_binary_op: memexpb = cast(AST.ASTBinaryOp, memref.memexp) exp1 = memexpb.exp1 @@ -511,7 +510,6 @@ def visit_memref(self, memref: AST.ASTMemRef) -> None: self.ccode.write("(*(") memref.memexp.accept(self) self.ccode.write("))") - ''' else: self.ccode.write("(*(") memref.memexp.accept(self) diff --git a/chb/cmdline/reportcmds.py b/chb/cmdline/reportcmds.py index 9641c24c..2f094c24 100644 --- a/chb/cmdline/reportcmds.py +++ b/chb/cmdline/reportcmds.py @@ -5,7 +5,7 @@ # ------------------------------------------------------------------------------ # The MIT License (MIT) # -# Copyright (c) 2021-2025 Aarno Labs, LLC +# Copyright (c) 2021-2026 Aarno Labs, LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -1316,15 +1316,30 @@ def include_target(target: 'CallTarget') -> bool: buffersize = stackframe.stackoffset_gap(dstoffset) if buffersize is None: chklogger.logger.warning( - "Stackbuffer for %s at offset %s does not have a size and no upperbound either", + "Stackbuffer for %s at offset %s does not have a size and " + + "no upperbound either", str(instr), str(dstoffset)) continue else: chklogger.logger.warning( - "Stackbuffer for %s at offset %s does not have a size, but stackframe " - + " allows a buffer of %s", + "Stackbuffer for %s at offset %s does not have a size, " + + "but stackframe allows a buffer of %s", str(instr), str(dstoffset), str(buffersize)) sizeorigin = "stackframe-layout" + elif buffersize == 1: + buffersize = stackframe.stackoffset_gap(dstoffset) + if buffersize is None: + chklogger.logger.warning( + "Stackbuffer size for %s at offset %s is reported to be 1 " + + " and no buffer size could be derived from the stacklayout", + str(instr), str(dstoffset)) + continue + else: + chklogger.logger.warning( + "Stackbuffer size for %s at offset %s is reported to be 1 " + + "; replacing it by the size derived from the stacklayout", + str(instr), str(dstoffset)) + sizeorigin = "stackframe-layout" else: sizeorigin = "stackslot-access"