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
1 changed files with 2 additions and 1 deletions

View File

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