Use more explicite garbage placholder value.

This commit is contained in:
cfreksen 2017-10-29 21:10:22 +01:00
parent 13017ef95b
commit 6b6dd9cf68
No known key found for this signature in database
GPG Key ID: EAC13EE101008978

View File

@ -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 = '<<Unitialized memory>>'
class Garbage(Enum):
GARBAGE = '<<Unitialized memory>>'
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')