allow (constant) expressions in array declarators

This commit is contained in:
Bill Currie 2010-01-13 06:23:32 +00:00 committed by Jeff Teunissen
parent a6c504936c
commit c2dcc20d2a

View file

@ -458,8 +458,9 @@ param
; ;
array_decl array_decl
: '[' const ']' : '[' fexpr ']'
{ {
$2 = constant_expr ($2);
if ($2->type != ex_integer || $2->e.integer_val < 1) { if ($2->type != ex_integer || $2->e.integer_val < 1) {
error (0, "invalid array size"); error (0, "invalid array size");
$$ = 0; $$ = 0;