From: Wolfgang (Blub) Bumiller Date: Fri, 30 Nov 2012 15:25:18 +0000 (+0100) Subject: Don't treat initialized non-consts as static array indices X-Git-Tag: 0.1.9~167 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=696a8629b3e6d88b9284030f26e77fef480ff526;p=xonotic%2Fgmqcc.git Don't treat initialized non-consts as static array indices --- diff --git a/ast.c b/ast.c index 7e59f03..2e9d2fd 100644 --- 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;