Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions chb/arm/opcodes/ARMStoreRegisterHalfword.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def ast_prov(
lhs, xdata, iaddr, astree, memaddr=memaddr)

elif xd.is_vmem_unknown and xd.is_address_known:
lhs = None
memaddr = xd.xaddr
hl_lhs = XU.xmemory_dereference_lval(memaddr, xdata, iaddr, astree)

Expand All @@ -216,7 +217,7 @@ def ast_prov(
bytestring=bytestring,
annotations=annotations)

if lhs.is_tmp:
if lhs is not None and lhs.is_tmp:
astree.add_expose_instruction(hl_assign.instrid)
astree.add_instr_mapping(hl_assign, ll_assign)
astree.add_instr_address(hl_assign, [iaddr])
Expand Down Expand Up @@ -265,4 +266,4 @@ def ast_prov(
ll_assigns = [ll_assign]
hl_assigns = [hl_assign]

return ([hl_assign], [ll_assign])
return (hl_assigns, ll_assigns)
9 changes: 5 additions & 4 deletions chb/userdata/UserHints.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,15 +529,16 @@ def offset(self) -> int:
"""

if not "offset" in self.varintro:
chklogger.logger.warning(
"Stack variable intro without offset; returning 0")
index = int(self.varintro.get("offset", "0"))
raise UF.CHBError(
"Stack variable intro without offset")

index = int(self.varintro["offset"])
if index > 0:
return -index
else:
raise UF.CHBError(
"Unexpected non-positive offset in stack-variable intro: "
+ str(self.offset))
+ str(index))

@property
def name(self) -> str:
Expand Down
Loading