]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Don't treat initialized non-consts as static array indices
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 15:25:18 +0000 (16:25 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 15:25:18 +0000 (16:25 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 7e59f0331aca46fda668dc1cfb73bf12a756e511..2e9d2fdf16540fe3fdd623bea6e4e328c1e714c1 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -2025,7 +2025,7 @@ bool ast_array_index_codegen(ast_array_index *self, ast_function *func, bool lva
     arr = (ast_value*)self->array;
     idx = (ast_value*)self->index;
 
-    if (!ast_istype(self->index, ast_value) || !idx->hasvalue) {
+    if (!ast_istype(self->index, ast_value) || !idx->hasvalue || idx->cvq != CV_CONST) {
         /* Time to use accessor functions */
         ast_expression_codegen *cgen;
         ir_value               *iridx, *funval;