public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-11383] Objective-C, Darwin: Fix a regression in handling bad receivers.
Date: Sat, 27 Apr 2024 16:24:01 +0000 (GMT)	[thread overview]
Message-ID: <20240427162401.9C9293858D1E@sourceware.org> (raw)

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

commit r11-11383-gc01efafd7fc6d3ff58db930fd785a8bcd991ac54
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 6 19:21:40 2024 +0000

    Objective-C, Darwin: Fix a regression in handling bad receivers.
    
    This is seen on 32b hosts with a 64b multilib, and is an ICE when
    the build has checking enabled.  The fix is to exit the routine
    early if the sender or receiver are already error_mark_node.
    
    gcc/objc/ChangeLog:
    
            * objc-next-runtime-abi-02.c
            (build_v2_objc_method_fixup_call): Early exit for cases
            where the sender or receiver are known to be in error.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit 846794ead2982fc85a3b1a83bbb831fa096b2b7c)

Diff:
---
 gcc/objc/objc-next-runtime-abi-02.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 2a4f87cc726..0c59299db05 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -1663,6 +1663,8 @@ build_v2_objc_method_fixup_call (int super_flag, tree method_prototype,
   rcv_p = (super_flag ? objc_super_type : objc_object_type);
 
   lookup_object = build_c_cast (input_location, rcv_p, lookup_object);
+  if (sender == error_mark_node || lookup_object == error_mark_node)
+    return error_mark_node;
 
   /* Use SAVE_EXPR to avoid evaluating the receiver twice.  */
   lookup_object = save_expr (lookup_object);

                 reply	other threads:[~2024-04-27 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240427162401.9C9293858D1E@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).