From 7dd31ccf77f2b7dd85c0ea227f6d1e041f15de37 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sat, 12 Jan 2013 15:49:31 +0100 Subject: [PATCH] entity setter array subscript needs to get a correct field type --- parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 32e9427..4459d7b 100644 --- a/parser.c +++ b/parser.c @@ -4191,6 +4191,9 @@ static ast_expression *array_field_setter_node( if (!subscript) return NULL; + subscript->expression.next = ast_type_copy(ast_ctx(subscript), (ast_expression*)subscript); + subscript->expression.vtype = TYPE_FIELD; + entfield = ast_entfield_new_force(ctx, (ast_expression*)entity, (ast_expression*)subscript, @@ -5011,7 +5014,7 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield goto cleanup; */ } - if (opts.standard == COMPILER_QCC && + if ((opts.standard == COMPILER_QCC || opts.standard == COMPILER_FTEQCC) && (old = parser_find_global(parser, var->name))) { parseerror(parser, "cannot declare a field and a global of the same name with -std=qcc"); -- 2.39.2