From baf6d3ead4c5c63f53a2bca221e35a9bc22f0843 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 14 Aug 2012 17:35:02 +0200 Subject: [PATCH] fixing ast_binstore_codegen's lvalue flag setting, now += on entfields works correctly --- ast.c | 2 +- data/parsing.qc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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"); }; -- 2.39.2