Forbid the use of array of functions
Prevent the following code from compiling: int (*fct)[42](int x); Reported-by: Abdul Wadud Mohammad Mohibur Rashid <mohibur_rashid@yahoo.com>
This commit is contained in:
parent
642b6d0f50
commit
a465b7f58f
1 changed files with 2 additions and 0 deletions
2
tccgen.c
2
tccgen.c
|
@ -3278,6 +3278,8 @@ static void post_type(CType *type, AttributeDef *ad)
|
|||
skip(']');
|
||||
/* parse next post type */
|
||||
post_type(type, ad);
|
||||
if (type->t == VT_FUNC)
|
||||
tcc_error("declaration of an array of functions");
|
||||
t1 |= type->t & VT_VLA;
|
||||
|
||||
if (t1 & VT_VLA) {
|
||||
|
|
Loading…
Reference in a new issue