Fix segfault with nested flex array structs
commit5201312cb242ea943848fcf864adacc44d3d190f
authorMichael Matz <matz@suse.de>
Mon, 15 Feb 2021 22:58:18 +0000 (15 23:58 +0100)
committerMichael Matz <matz@suse.de>
Mon, 15 Feb 2021 23:01:28 +0000 (16 00:01 +0100)
tree63e0bdec8d5eead8dd3bffa229ab0d5c7c6e0c02
parent3658c29b432f9dbb626cecba725af45da3e3ae8b
Fix segfault with nested flex array structs

when used with string initialization the size of nested struct flex
array member was tested too late for < 0.

GCC accepts but discards such initializers (the flex array member will
become zero sized).  TCC supports flex arrays members only in
top-level structs and gives an error in this case.
tccgen.c
tests/tests2/60_errors_and_warnings.c
tests/tests2/60_errors_and_warnings.expect