Correctly compute the type of an assignment expression.
This change enables following types of statements to work correctly:
a = b = 3;
if ((a = getchar()) < 0) { ... }
This fixes 2232082 acc: assignment in comparison segfaults
diff --git a/libacc/tests/test.py b/libacc/tests/test.py
index c982d16..d984301 100644
--- a/libacc/tests/test.py
+++ b/libacc/tests/test.py
@@ -426,6 +426,11 @@
result: -2
""","""""")
+ def testAssignment(self):
+ self.compileCheck(["-R", "data/assignment.c"], """Executing compiled code:
+result: 7
+""","""""")
+
def testArray(self):
self.compileCheck(["-R", "data/array.c"], """Executing compiled code:
localInt: 3