https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99106

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:af868e89ec21340d1cafd26eaed356ce4b0104c3

commit r10-9471-gaf868e89ec21340d1cafd26eaed356ce4b0104c3
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Feb 17 15:03:25 2021 +0100

    c++: Fix up build_zero_init_1 once more [PR99106]

    My earlier build_zero_init_1 patch for flexible array members created
    an empty CONSTRUCTOR.  As the following testcase shows, that doesn't work
    very well because the middle-end doesn't expect CONSTRUCTOR elements with
    incomplete type (that the empty CONSTRUCTOR at the end of outer CONSTRUCTOR
    had).

    The following patch just doesn't add any CONSTRUCTOR for the flexible array
    members, it doesn't seem to be needed.

    2021-02-17  Jakub Jelinek  <ja...@redhat.com>

            PR sanitizer/99106
            * init.c (build_zero_init_1): For flexible array members just
return
            NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
            ARRAY_TYPE.

            * g++.dg/ubsan/pr99106.C: New test.

    (cherry picked from commit 7768cadb4246117964a9ba159740da3b9c20811d)

Reply via email to