From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A8FB7384AB50; Tue, 23 Apr 2024 14:11:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8FB7384AB50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713881469; bh=WMDeo9Td8OgyQYGJfqer2h6vGDTACbINIV2ZEaGZ8zU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nrE9Dqbi0KHHHHy4g0jL3NXldvxoGj7E37cDyy0dwXXxe3XQYBKSWh76bpZeWuwSo MENTvrPgcLHuB5FnpWER0dDbaBePvOuZY9sHuwLdu2qfmrTfCvx4aFw8L3Bv9TGMip xWXa6H+XD2zhLruuXXaa4qZzHYwj5RGoP3v1UMb8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug objc/101666] Objective-C frontend crashes with `-fobjc-nilcheck` Date: Tue, 23 Apr 2024 14:11:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: objc X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: iains at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101666 --- Comment #9 from GCC Commits --- The releases/gcc-11 branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:87431b4a81e9dc5988509399704a7352800c6a77 commit r11-11339-g87431b4a81e9dc5988509399704a7352800c6a77 Author: Iain Sandoe 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 front= end crashes when it encounters this situation. This patch fixes the crash = by generating the tree for the `{}` initializer. Signed-off-by: Iain Sandoe Co-authored-by: Matt Jacobson 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)=