History

prevent internal segfault on apparent VLA at file scope

Joe Soroka committed 15 years ago

Commit c85f77d1 parent 1446b541 file · +2 −0Browse files

Unified · Split

tccgen.c+2−0
@@ -3169,6 +3169,8 @@ static void post_type(CType *type, AttributeDef *ad) · 3168 unmodified lines
31693169 n = vtop->c.i;
31703170 if (n < 0)
31713171 error("invalid array size");
3172+ } else if (!local_stack) {
3173+ error("expected constant expression (variably modified array at file scope)");
31723174 } else {
31733175 if (!is_integer_btype(vtop->type.t & VT_BTYPE))
31743176 error("size of variable length array should be an integer");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t