Skip to content

Commit 7c2c92d

Browse files
committed
Implement arrays and a preprocessor
1 parent 5c02173 commit 7c2c92d

File tree

5 files changed

+552
-120
lines changed

5 files changed

+552
-120
lines changed

assembler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@ def handle_insn(self, insn, args):
469469

470470
if self.jump_later:
471471
if old_jump_later is not None:
472-
self.add_command(Function(old_jump_later))
472+
# Only jump if haven't unconditionally jumped elsewhere
473+
if self.curr_func != '__unreachable__':
474+
self.add_command(Function(old_jump_later))
473475
self.curr_func = old_jump_later
474476
if self.jump_later == old_jump_later:
475477
self.jump_later = None
@@ -654,7 +656,7 @@ def do_equality_jump(self, dest_arg, is_truth):
654656
arg_type, symbol = dest_arg
655657
assert arg_type == 'symbol'
656658
if not self.comparison_args:
657-
return
659+
raise RuntimeError('No corresponding comparison for jump')
658660
commands, left, right = self.comparison_args
659661
if isinstance(left, Ref) and isinstance(right, Ref):
660662
for command in commands:

0 commit comments

Comments
 (0)