From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 9C9293858D1E; Sat, 27 Apr 2024 16:24:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C9293858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714235041; bh=dVr0nKreRsmbHXCmphfDF7+6CDarn4OQ/T5IEhZk9As=; h=From:To:Subject:Date:From; b=A9nzKy4ruaZlvEHoJF9/v7h1vgn99pRA+c7DpsLFiOSjxIYnj0eLXNC1NR0DDAe4M sEBs6w9rmEyY+Xxss6BB+rNS0eP1mAFejhJFZEdmLy0BLd63t1C2xw5IKgu69fx3D/ 8mnNTkoK6ShX3tZfNdxGkxHO7IOCrywcFuQverg4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11383] Objective-C, Darwin: Fix a regression in handling bad receivers. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 293140dfc6dbe7ab70c1f031f0dac6939bb084d6 X-Git-Newrev: c01efafd7fc6d3ff58db930fd785a8bcd991ac54 Message-Id: <20240427162401.9C9293858D1E@sourceware.org> Date: Sat, 27 Apr 2024 16:24:01 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c01efafd7fc6d3ff58db930fd785a8bcd991ac54 commit r11-11383-gc01efafd7fc6d3ff58db930fd785a8bcd991ac54 Author: Iain Sandoe 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 (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);