From b09d0c0b7684abd4efd675a4ee0cb6baa8f780a5 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Mon, 21 Oct 2019 17:15:28 +0100 Subject: [PATCH] Routines that are goto'd are also in the call graph. --- src/sixtypical/analyzer.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/sixtypical/analyzer.py b/src/sixtypical/analyzer.py index 39fc5f7..aee46f5 100644 --- a/src/sixtypical/analyzer.py +++ b/src/sixtypical/analyzer.py @@ -517,17 +517,17 @@ class Analyzer(object): raise NotImplementedError(opcode) def analyze_call(self, instr, context): - type = self.get_type(instr.location) - if not isinstance(type, (RoutineType, VectorType)): + type_ = self.get_type(instr.location) + if not isinstance(type_, (RoutineType, VectorType)): raise TypeMismatchError(instr, instr.location.name) - context.mark_as_called(instr.location, type) - if isinstance(type, VectorType): - type = type.of_type - for ref in type.inputs: + context.mark_as_called(instr.location, type_) + if isinstance(type_, VectorType): + type_ = type_.of_type + for ref in type_.inputs: context.assert_meaningful(ref) - for ref in type.outputs: + for ref in type_.outputs: context.set_written(ref) - for ref in type.trashes: + for ref in type_.trashes: context.assert_writeable(ref) context.set_touched(ref) context.set_unmeaningful(ref) @@ -538,6 +538,7 @@ class Analyzer(object): if not isinstance(type_, (RoutineType, VectorType)): raise TypeMismatchError(instr, location.name) + context.mark_as_called(instr.location, type_) # assert that the dest routine's inputs are all initialized if isinstance(type_, VectorType):