From: Wolfgang (Blub) Bumiller Date: Tue, 14 Aug 2012 15:35:02 +0000 (+0200) Subject: fixing ast_binstore_codegen's lvalue flag setting, now += on entfields works correctly X-Git-Tag: 0.1-rc1~291 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=baf6d3ead4c5c63f53a2bca221e35a9bc22f0843;p=xonotic%2Fgmqcc.git fixing ast_binstore_codegen's lvalue flag setting, now += on entfields works correctly --- diff --git a/ast.c b/ast.c index c99a051..41a53f0 100644 --- 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 */ diff --git a/data/parsing.qc b/data/parsing.qc index 2e202ce..f1207c8 100644 --- a/data/parsing.qc +++ b/data/parsing.qc @@ -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"); };