From bda5ff4213c20af848afe933cee9003b7f7a40d1 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 30 Nov 2012 16:28:09 +0100 Subject: [PATCH] update other value/const check for array indexing --- ast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.2