From a7a3627ab2f9f06e7725c6b6c796984684d0fdb8 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Fri, 5 May 2017 22:01:02 +0200 Subject: Fix segfault with invalid function def This invalid function definition: int f()[] {} was tried to be handled but there was no testcase if it actually worked. This fixes it and adds a TCC only testcase. --- tests/tcctest.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/tcctest.c') diff --git a/tests/tcctest.c b/tests/tcctest.c index e86a2a6..b6e4116 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -176,6 +176,11 @@ static int onetwothree = 123; #define B3 4 #endif +#ifdef __TINYC__ +/* We try to handle this syntax. Make at least sure it doesn't segfault. */ +char invalid_function_def()[] {} +#endif + #define __INT64_C(c) c ## LL #define INT64_MIN (-__INT64_C(9223372036854775807)-1) -- cgit v1.3.1