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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<ia...@gcc.gnu.org>:

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

commit r10-10798-gacd300cfdc434f03f1b08e46bca98b963d43ebc3
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Sat Aug 14 12:27:55 2021 +0100

    Objective-C: fix crash with -fobjc-nilcheck

    When -fobjc-nilcheck is enabled, messages that result in a struct type
should
    yield a zero-initialized struct when sent to nil.  Currently, the frontend
    crashes when it encounters this situation.  This patch fixes the crash by
    generating the tree for the `{}` initializer.

    Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>
    Co-authored-by: Matt Jacobson  <mhjacob...@me.com>

            PR objc/101666

    gcc/objc/ChangeLog:

            * objc-act.c (objc_build_constructor): Handle empty constructor
            lists.
            * objc-next-runtime-abi-02.c (build_v2_objc_method_fixup_call):
            Handle nil receivers.
            (build_v2_build_objc_method_call): Likewise.

    gcc/testsuite/ChangeLog:

            * obj-c++.dg/pr101666-0.mm: New test.
            * obj-c++.dg/pr101666-1.mm: New test.
            * obj-c++.dg/pr101666.inc: New.
            * objc.dg/pr101666-0.m: New test.
            * objc.dg/pr101666-1.m: New test.
            * objc.dg/pr101666.inc: New.

    (cherry picked from commit d2aa4e0b3b5053df8f5853d9ed29022ff0d3ecf6)

Reply via email to