bug fix with invalid binary operator in modify-assignment
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 10 Jan 2021 16:20:59 +0000 (10:20 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 10 Jan 2021 16:20:59 +0000 (10:20 -0600)
bin/onyx
onyx.exe
src/onyxchecker.c

index 3e082051996fcb9099c98b11748fe16ca3e30990..d037de2bac4b64a1e8e5713bc14ad51e41b2e3a1 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 705afc12056f72f313a0e0476ead17e91d0e7c0d..e5ff0df105cc783a01c81133eb15ea1668e56f8b 100644 (file)
Binary files a/onyx.exe and b/onyx.exe differ
index 104f089d2f33a41aa36fdc06e6439308d76f8e7b..cd0147cae37f2b1e7562b77e1fb744ec4c4f4d88 100644 (file)
@@ -594,7 +594,6 @@ CheckStatus check_binop_assignment(AstBinaryOp* binop, b32 assignment_is_ok) {
         binop_node->token = binop->token;
         binop_node->left  = binop->left;
         binop_node->right = binop->right;
-        binop_node->type  = binop->right->type;
 
         if      (binop->operation == Binary_Op_Assign_Add)      binop_node->operation = Binary_Op_Add;
         else if (binop->operation == Binary_Op_Assign_Minus)    binop_node->operation = Binary_Op_Minus;
@@ -608,10 +607,10 @@ CheckStatus check_binop_assignment(AstBinaryOp* binop, b32 assignment_is_ok) {
         else if (binop->operation == Binary_Op_Assign_Shr)      binop_node->operation = Binary_Op_Shr;
         else if (binop->operation == Binary_Op_Assign_Sar)      binop_node->operation = Binary_Op_Sar;
 
+        CHECK(binaryop, &binop_node, 0);
+
         binop->right = (AstTyped *) binop_node;
         binop->operation = Binary_Op_Assign;
-
-        CHECK(binaryop, &binop_node, 0);
     }
 
     if (!type_check_or_auto_cast(&binop->right, binop->left->type)) {