Skip to content

Commit 49a9ccf

Browse files
committed
APP: initial redesign for handling stack variables
1 parent 9c23ede commit 49a9ccf

File tree

16 files changed

+218
-782
lines changed

16 files changed

+218
-782
lines changed

chb/app/CHVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
chbversion: str = "0.3.0-20250729"
1+
chbversion: str = "0.3.0-20250801"

chb/app/FnStackFrame.py

Lines changed: 0 additions & 335 deletions
This file was deleted.

chb/app/Function.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
GlobalLoad, GlobalStore, GlobalAddressArgument)
6464
from chb.app.Instruction import Instruction
6565
from chb.app.JumpTables import JumpTable
66-
from chb.app.StackLayout import StackLayout
6766
from chb.app.StringXRefs import StringsXRefs
6867

6968
import chb.ast.ASTNode as AST
@@ -91,7 +90,7 @@
9190

9291
if TYPE_CHECKING:
9392
from chb.app.AppAccess import AppAccess
94-
from chb.app.FnStackFrame import FnStackFrame
93+
from chb.app.FunctionStackframe import FunctionStackframe
9594
from chb.app.GlobalMemoryMap import (
9695
GlobalMemoryMap, GlobalLocation, GlobalReference)
9796
from chb.bctypes.BCTyp import BCTyp
@@ -125,7 +124,6 @@ def __init__(
125124
self._varinvd: Optional[FnVarInvDictionary] = None
126125
self._invariants: Dict[str, List[InvariantFact]] = {}
127126
self._varinvariants: Dict[str, List[VarInvariantFact]] = {}
128-
self._stacklayout: Optional[StackLayout] = None
129127
self._globalrefs: Optional[Dict[str, List["GlobalReference"]]] = None
130128
self._proofobligations: Optional[FnProofObligations] = None
131129

@@ -393,7 +391,7 @@ def cfg(self) -> Cfg:
393391
raise UF.CHBError("Property cfg not implemented for Function")
394392

395393
@property
396-
def stackframe(self) -> "FnStackFrame":
394+
def stackframe(self) -> "FunctionStackframe":
397395
raise UF.CHBError("Property stackframe not implemented for Function")
398396

399397
@property
@@ -544,18 +542,6 @@ def lhs_types(self) -> Dict[str, Dict[str, "BCTyp"]]:
544542

545543
return result
546544

547-
def stacklayout(self) -> StackLayout:
548-
if self._stacklayout is None:
549-
stacklayout = StackLayout()
550-
for (iaddr, instr) in self.instructions.items():
551-
memaccesses = instr.memory_accesses
552-
if any(a.is_stack_address for a in memaccesses):
553-
stacklayout.add_access(instr)
554-
if instr.is_call_instruction:
555-
stacklayout.add_access(instr)
556-
self._stacklayout = stacklayout
557-
return self._stacklayout
558-
559545
def globalrefs(self) -> Dict[str, List["GlobalReference"]]:
560546
if self._globalrefs is None:
561547
self._globalrefs = {}

0 commit comments

Comments
 (0)