From: Wolfgang (Blub) Bumiller Date: Fri, 30 Nov 2012 15:28:09 +0000 (+0100) Subject: update other value/const check for array indexing X-Git-Tag: 0.1.9~166 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bda5ff4213c20af848afe933cee9003b7f7a40d1;p=xonotic%2Fgmqcc.git update other value/const check for array indexing --- diff --git a/ast.c b/ast.c index 2e9d2fd..25be65b 100644 --- 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; }