ART: Fixed subsequent CHECK-NOTs Checker bug
Matching a group of CHECK-NOT lines caused Checker to crash due to
incorrectly overwriting the varState variable. The second use of the
variable was renamed and a regression test added.
Change-Id: I1a879cf5368acca6b5092f69a9caa47b89a79532
diff --git a/tools/checker.py b/tools/checker.py
index 5e910ec..0813d0c 100755
--- a/tools/checker.py
+++ b/tools/checker.py
@@ -440,9 +440,9 @@
def __matchNotLines(self, checkLines, outputLines, startLineNo, varState):
for checkLine in checkLines:
assert checkLine.variant == CheckLine.Variant.Not
- matchLineNo, varState = \
+ matchLineNo, matchVarState = \
self.__findFirstMatch(checkLine, outputLines, startLineNo, [], varState)
- if varState is not None:
+ if matchVarState is not None:
Logger.testFailed("CHECK-NOT line \"" + checkLine.content + "\" matches output line " + \
str(matchLineNo), self.fileName, checkLine.lineNo)
diff --git a/tools/checker_test.py b/tools/checker_test.py
index 9b04ab0..2846a9c 100755
--- a/tools/checker_test.py
+++ b/tools/checker_test.py
@@ -342,6 +342,10 @@
self.__notMatchMulti([("foo", CheckVariant.Not)],
"""abc foo
def""")
+ self.__notMatchMulti([("foo", CheckVariant.Not),
+ ("bar", CheckVariant.Not)],
+ """abc
+ def bar""")
def test_LineOnlyMatchesOnce(self):
self.__matchMulti([("foo", CheckVariant.DAG),