From 01e3ab00aa6cd288fbc4a5c442887ac1dadc2610 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Wed, 25 Apr 2018 13:40:39 +0100 Subject: [PATCH] Make tests pass. --- src/sixtypical/analyzer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sixtypical/analyzer.py b/src/sixtypical/analyzer.py index f1b99fe..3a17c2a 100644 --- a/src/sixtypical/analyzer.py +++ b/src/sixtypical/analyzer.py @@ -420,6 +420,8 @@ class Analyzer(object): self.analyze_for(instr, context) elif isinstance(instr, WithInterruptsOff): self.analyze_block(instr.block, context) + if context.encountered_gotos(): + raise IllegalJumpError(instr, instr) elif isinstance(instr, Save): self.analyze_save(instr, context) else: @@ -776,7 +778,8 @@ class Analyzer(object): baton = context.extract(location) self.analyze_block(instr.block, context) - # TODO assert no goto was encountered + if context.encountered_gotos(): + raise IllegalJumpError(instr, instr) context.re_introduce(baton) if location == REG_A: