]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
update other value/const check for array indexing
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 15:28:09 +0000 (16:28 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 15:28:09 +0000 (16:28 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 2e9d2fdf16540fe3fdd623bea6e4e328c1e714c1..25be65bc39f701b8450e913a25a8cbb887298536 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1552,7 +1552,7 @@ bool ast_store_codegen(ast_store *self, ast_function *func, bool lvalue, ir_valu
         ai = (ast_array_index*)self->dest;
         idx = (ast_value*)ai->index;
 
-        if (ast_istype(ai->index, ast_value) && idx->hasvalue)
+        if (ast_istype(ai->index, ast_value) && idx->hasvalue && idx->cvq == CV_CONST)
             ai = NULL;
     }
 
@@ -1776,7 +1776,7 @@ bool ast_binstore_codegen(ast_binstore *self, ast_function *func, bool lvalue, i
         ai = (ast_array_index*)self->dest;
         idx = (ast_value*)ai->index;
 
-        if (ast_istype(ai->index, ast_value) && idx->hasvalue)
+        if (ast_istype(ai->index, ast_value) && idx->hasvalue && idx->cvq == CV_CONST)
             ai = NULL;
     }