From 696a8629b3e6d88b9284030f26e77fef480ff526 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 30 Nov 2012 16:25:18 +0100 Subject: [PATCH] Don't treat initialized non-consts as static array indices --- ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2