Skip to content

Commit

Permalink
[core/state] Fix crash dump
Browse files Browse the repository at this point in the history
It didn't handle debug_frame.MainEntry().  Now I think we can ignore
those entries.
  • Loading branch information
Andy C committed Feb 9, 2025
1 parent b3ef6f4 commit 94d1965
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,17 +1314,17 @@ def Dump(self):
# Reuse these immutable objects
t_call = value.Str('Call')
t_source = value.Str('Source')
t_main = value.Str('MainFile')

for frame in reversed(self.debug_stack):
UP_frame = frame
d = None # type: Optional[Dict[str, value_t]]
with tagswitch(frame) as case:
if case(debug_frame_e.Call):
frame = cast(debug_frame.Call, UP_frame)
d = {
'type': t_call,
'func_name': value.Str(frame.func_name)
} # type: Dict[str, value_t]
}

_AddCallToken(d, frame.call_tok)
# TODO: Add def_tok
Expand All @@ -1337,14 +1337,10 @@ def Dump(self):
}
_AddCallToken(d, frame.call_tok)

elif case(debug_frame_e.MainFile):
frame = cast(debug_frame.MainFile, UP_frame)
d = {
'type': t_main,
'filename': value.Str(frame.main_filename)
}
# Note: Skip debug_frame.MainFile
if d:
debug_stack.append(value.Dict(d))

debug_stack.append(value.Dict(d))
return var_stack, argv_stack, debug_stack

def SetLastArgument(self, s):
Expand Down

0 comments on commit 94d1965

Please sign in to comment.