History

vla: Fix check for vla used by autoconf

1) recursive types have no storage anymore, so a static int (*p)[x]; declaration is just fine 2) since somewhen VT_VLA doesn't imply VT_ARRAY anymore, so we now need to check VLA in at least one place before checking test_lvalue. ((2) should probably be cleaned up again so that VLA does again imply ARRAY)

Michael Matz committed 4 years ago

Commit fa256301 parent 76b88e22 files · +8 −4Browse files

Showing the changes to tccgen.c (1 of 2 files). Show all

Unified · Split

tccgen.c+3−2
@@ -5018,7 +5018,8 @@ static CType *type_decl(CType *type, AttributeDef *ad, int *v, int td) · 5017 unmodified lines
50185018 expect("identifier");
50195019 *v = 0;
50205020 }
5021− post_type(post, ad, storage, td & ~(TYPE_DIRECT|TYPE_ABSTRACT));
5021+ post_type(post, ad, post != ret ? 0 : storage,
5022+ td & ~(TYPE_DIRECT|TYPE_ABSTRACT));
50225023 parse_attribute(ad);
50235024 type->t |= storage;
50245025 return ret;
@@ -5437,7 +5438,7 @@ ST_FUNC void unary(void) · 412 unmodified lines
54375438 there and in function calls. */
54385439 /* arrays can also be used although they are not lvalues */
54395440 if ((vtop->type.t & VT_BTYPE) != VT_FUNC &&
5440− !(vtop->type.t & VT_ARRAY))
5441+ !(vtop->type.t & (VT_ARRAY | VT_VLA)))
54415442 test_lvalue();
54425443 if (vtop->sym)
54435444 vtop->sym->a.addrtaken = 1;

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