From 138eb3fc721ea0a7e28559c417a2e4ad4768ea21 Mon Sep 17 00:00:00 2001 From: cfreksen Date: Sun, 29 Oct 2017 18:42:56 +0100 Subject: [PATCH] Refactor handling of Ret. --- stepper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stepper.py b/stepper.py index 4c95558..ee4f774 100644 --- a/stepper.py +++ b/stepper.py @@ -63,12 +63,16 @@ def terminate(terminator, blocks, stack_frames, ssa_env, global_env, memory): else: oper_v = eval_oper(oper, ssa_env, global_env) 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: new_insns, new_terminator, new_blocks, new_ssa_env = stack_frames[0] new_stack_frames = stack_frames[1:] - return (new_insns, new_terminator, new_blocks, new_stack_frames, - new_ssa_env, memory, oper_v) + return (new_insns, new_terminator, new_blocks, new_stack_frames, + new_ssa_env, memory, oper_v) elif isinstance(terminator, ll.Br): label = terminator.label next_block = blocks[label]