|
From: | Michael Matz |
Subject: | Re: [Tinycc-devel] core dump with flex arrays |
Date: | Tue, 16 Feb 2021 00:05:25 +0100 (CET) |
User-agent: | Alpine 2.21 (LSU 202 2017-01-01) |
Hello, On Mon, 15 Feb 2021, Herman ten Brugge via Tinycc-devel wrote:
I ran the tests/gcctestsuite.sh script and found one test that dumps core. ($GCC_DIR/gcc/testsuite/gcc.c-torture/compile/pr28865.c) The reduced testcase is: struct A { int a; char b[]; }; struct A a = { 1, "1" }; struct B { struct A a; }; struct B b = { { 1, "1" } }; line 2 works and line 4 dumps core. I am not sure how to fix this.
Fixed in mob. The cause is the discrepancy in handling string vs. normal array initializers. The former wasn't checking for the problematic situation.
(Note that TCC and GCC behave different with non-top-level flex array members: GCC accepts but discards initializers of these with a warning, TCC rejects them. That's fine, flex array members are an extension.)
Ciao, Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |