When storing to a vector member as part of an entity field we must use STOREP
authorDale Weiler <weilercdale@gmail.com>
Wed, 10 Dec 2014 07:40:35 +0000 (02:40 -0500)
committerDale Weiler <weilercdale@gmail.com>
Wed, 10 Dec 2014 07:40:35 +0000 (02:40 -0500)
parser.c

index e1779da37667f157085c3e40322378c01fd657fd..4a09583593a97c5cebe19090d9f5368e7ed89e7e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -953,6 +953,9 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
                 }
             }
             (void)check_write_to(ctx, exprs[0]);
+            /* When we're a vector of part of an entity field we use STOREP */
+            if (ast_istype(exprs[0], ast_member) && ast_istype(((ast_member*)exprs[0])->owner, ast_entfield))
+                assignop = INSTR_STOREP_F;
             out = (ast_expression*)ast_store_new(ctx, assignop, exprs[0], exprs[1]);
             break;
         case opid3('+','+','P'):