From aa5e4119da7dc7b8f8da643ed25c588f4db45b99 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Fri, 8 Dec 2017 15:07:15 +0000 Subject: [PATCH] Copy indexed location to location. All tests pass again. --- src/sixtypical/analyzer.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sixtypical/analyzer.py b/src/sixtypical/analyzer.py index 56414a9..8ef8ed7 100644 --- a/src/sixtypical/analyzer.py +++ b/src/sixtypical/analyzer.py @@ -355,6 +355,12 @@ class Analyzer(object): else: raise TypeMismatchError((src, dest)) + elif isinstance(src, IndexedRef) and isinstance(dest, LocationRef): + if src.ref.type == TYPE_WORD_TABLE and dest.type == TYPE_WORD: + pass + else: + raise TypeMismatchError((src, dest)) + elif isinstance(src, (LocationRef, ConstantRef)) and isinstance(dest, LocationRef): if src.type == dest.type: pass @@ -382,7 +388,15 @@ class Analyzer(object): elif isinstance(src, IndirectRef) and isinstance(dest, LocationRef): context.assert_meaningful(src.ref, REG_Y) # TODO this will need to be more sophisticated. the thing ref points to is touched, as well. - context.set_touched(src.ref) + context.set_touched(src.ref) # TODO and REG_Y? if not, why not? + context.set_written(dest) + elif isinstance(src, LocationRef) and isinstance(dest, IndexedRef): + context.assert_meaningful(src, dest.ref, dest.index) + context.set_touched(src) # TODO and dest.index? + context.set_written(dest.ref) + elif isinstance(src, IndexedRef) and isinstance(dest, LocationRef): + context.assert_meaningful(src.ref, src.index, dest) + context.set_touched(dest) # TODO and src.index? context.set_written(dest) else: context.assert_meaningful(src)