From a465b7f58fdea15caa1bfb81ff5e985c94c4df4a Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 19 Sep 2013 18:58:46 +0200 Subject: [PATCH] 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 --- tccgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tccgen.c b/tccgen.c index a9373585..33c42de8 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) {