From 6b6dd9cf680f01999c555cada7c8472cc3905ba7 Mon Sep 17 00:00:00 2001 From: cfreksen Date: Sun, 29 Oct 2017 21:10:22 +0100 Subject: [PATCH] Use more explicite garbage placholder value. --- stepper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stepper.py b/stepper.py index 769c2df..5d11eaa 100644 --- a/stepper.py +++ b/stepper.py @@ -1,6 +1,8 @@ import ll import parser +from enum import Enum + def TODO(msg): print('TODO: not implemented yet at {}' @@ -17,7 +19,8 @@ def warn(msg): .format(msg)) -GARBAGE = '<>' +class Garbage(Enum): + GARBAGE = '<>' def step(insns, terminator, blocks, stack_frames, ssa_env, global_env, memory, @@ -55,7 +58,8 @@ def step(insns, terminator, blocks, stack_frames, ssa_env, global_env, memory, ptr = len(memory) for i in range(max(size, 1)): - memory.append(GARBAGE) + memory.append(Garbage.GARBAGE) + res = ptr elif isinstance(next_insn, ll.Load): TODO('Load')