From 0636f42c5ca92e692f15c1b31d2a0bc49f1a6d7a Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sun, 17 Feb 2008 10:49:45 +0000 Subject: [PATCH] only make implicit cast if array size expression != NULL [r18888] --- parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index afa990e..d0c489b 100644 --- a/parser.c +++ b/parser.c @@ -2501,8 +2501,11 @@ static type_t *construct_declarator_type(construct_type_t *construct_list, parsed_array_t *parsed_array = (parsed_array_t*) iter; type_t *array_type = allocate_type_zero(TYPE_ARRAY, (source_position_t){NULL, 0}); - expression_t *size_expression - = create_implicit_cast(parsed_array->size, type_size_t); + expression_t *size_expression = parsed_array->size; + if(size_expression != NULL) { + size_expression + = create_implicit_cast(size_expression, type_size_t); + } array_type->base.qualifiers = parsed_array->type_qualifiers; array_type->array.element_type = type; -- 2.20.1