allow (constant) expressions in array declarators
This commit is contained in:
parent
a6c504936c
commit
c2dcc20d2a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue