Skip to content

Commit 2a628a7

Browse files
waskyosipma
authored andcommitted
fix infinite recursion when no stack offset present in variable introduction
this also fixes how we handle a stack variable introduction without an offset. Before we would issue a warning, then raise the non-positive error. This switches it to raising an error if the offset is not there, and also issue an error if the values is non-positive
1 parent b29f97e commit 2a628a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

chb/userdata/UserHints.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,16 @@ def offset(self) -> int:
529529
"""
530530

531531
if not "offset" in self.varintro:
532-
chklogger.logger.warning(
533-
"Stack variable intro without offset; returning 0")
534-
index = int(self.varintro.get("offset", "0"))
532+
raise UF.CHBError(
533+
"Stack variable intro without offset")
534+
535+
index = int(self.varintro["offset"])
535536
if index > 0:
536537
return -index
537538
else:
538539
raise UF.CHBError(
539540
"Unexpected non-positive offset in stack-variable intro: "
540-
+ str(self.offset))
541+
+ str(index))
541542

542543
@property
543544
def name(self) -> str:

0 commit comments

Comments
 (0)