aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-09-19 18:58:46 +0200
committerThomas Preud'homme <robotux@celest.fr>2013-09-19 18:58:46 +0200
commita465b7f58fdea15caa1bfb81ff5e985c94c4df4a (patch)
tree8cbd68abe8e279e3a8d9f294bfc865e6ffac56b7
parent642b6d0f50c6b6a842c9239a102fe34d5619e931 (diff)
downloadtinycc-a465b7f58fdea15caa1bfb81ff5e985c94c4df4a.tar.gz
tinycc-a465b7f58fdea15caa1bfb81ff5e985c94c4df4a.tar.bz2
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>
-rw-r--r--tccgen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index a937358..33c42de 100644
--- a/tccgen.c
+++ b/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) {