Refactor handling of Ret.
This commit is contained in:
parent
a4885103c0
commit
138eb3fc72
10
stepper.py
10
stepper.py
|
@ -63,12 +63,16 @@ def terminate(terminator, blocks, stack_frames, ssa_env, global_env, memory):
|
||||||
else:
|
else:
|
||||||
oper_v = eval_oper(oper, ssa_env, global_env)
|
oper_v = eval_oper(oper, ssa_env, global_env)
|
||||||
if len(stack_frames) == 0:
|
if len(stack_frames) == 0:
|
||||||
return [], None, [], [], ssa_env, memory, oper_v
|
new_insns = []
|
||||||
|
new_terminator = None
|
||||||
|
new_blocks = {}
|
||||||
|
new_ssa_env = ssa_env
|
||||||
|
new_stack_frames = []
|
||||||
else:
|
else:
|
||||||
new_insns, new_terminator, new_blocks, new_ssa_env = stack_frames[0]
|
new_insns, new_terminator, new_blocks, new_ssa_env = stack_frames[0]
|
||||||
new_stack_frames = stack_frames[1:]
|
new_stack_frames = stack_frames[1:]
|
||||||
return (new_insns, new_terminator, new_blocks, new_stack_frames,
|
return (new_insns, new_terminator, new_blocks, new_stack_frames,
|
||||||
new_ssa_env, memory, oper_v)
|
new_ssa_env, memory, oper_v)
|
||||||
elif isinstance(terminator, ll.Br):
|
elif isinstance(terminator, ll.Br):
|
||||||
label = terminator.label
|
label = terminator.label
|
||||||
next_block = blocks[label]
|
next_block = blocks[label]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user