diff options
| author | Michael Matz <matz@suse.de> | 2017-05-05 22:01:02 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-05-05 22:01:02 +0200 |
| commit | a7a3627ab2f9f06e7725c6b6c796984684d0fdb8 (patch) | |
| tree | 857f9f8e1979ebec82f1680170c0c671aed83cd2 /tccgen.c | |
| parent | d4878985e85c01888c917a2ebcb5c533961fe53b (diff) | |
| download | tinycc-a7a3627ab2f9f06e7725c6b6c796984684d0fdb8.tar.gz tinycc-a7a3627ab2f9f06e7725c6b6c796984684d0fdb8.tar.bz2 | |
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.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4013,7 +4013,7 @@ static int post_type(CType *type, AttributeDef *ad, int storage, int td) if (tok == '[') { next(); skip(']'); /* only handle simple "[]" */ - type->t |= VT_PTR; + mk_pointer(type); } /* we push a anonymous symbol which will contain the function prototype */ ad->a.func_args = arg_size; |
