]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
fixing ast_binstore_codegen's lvalue flag setting, now += on entfields works correctly
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 14 Aug 2012 15:35:02 +0000 (17:35 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 14 Aug 2012 15:35:02 +0000 (17:35 +0200)
ast.c
data/parsing.qc

diff --git a/ast.c b/ast.c
index c99a051b36fefb48a613f56d8348f6b6ed81874c..41a53f0bc8a76b626f3a4b4db68004c89189c6e6 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1013,7 +1013,7 @@ bool ast_binstore_codegen(ast_binstore *self, ast_function *func, bool lvalue, i
     /* for a binstore we need both an lvalue and an rvalue for the left side */
     /* rvalue of destination! */
     cgen = self->dest->expression.codegen;
-    if (!(*cgen)((ast_expression*)(self->dest), func, true, &leftr))
+    if (!(*cgen)((ast_expression*)(self->dest), func, false, &leftr))
         return false;
 
     /* source as rvalue only */
index 2e202ce562d14d16494459476554a1f3e1466b14..f1207c8570339b2ce1e189a5a10ec819faa032c9 100644 (file)
@@ -51,8 +51,12 @@ void() main = {
     float b;
     a = 5;
     print3("a = ", ftos(a), "\n");
-    b = (a += 7);
+    b = a += 7;
     print("adding\n");
     print3("a = ", ftos(a), "\n");
     print3("b = ", ftos(a), "\n");
+
+    print3("memb = ", ftos(pawn.memb), "\n");
+    pawn.memb += 1;
+    print3("memb = ", ftos(pawn.memb), "\n");
 };