aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-01-06 19:21:40 +0000
committerIain Sandoe <iain@sandoe.co.uk>2024-01-12 14:09:29 +0000
commit846794ead2982fc85a3b1a83bbb831fa096b2b7c (patch)
tree383ae73b8a30dead8b9a454bd86ae088e4ed0359
parent4e6f7a3d5c8a6d6e2f14a8a5f6f62b3ae9549b1d (diff)
downloadgcc-846794ead2982fc85a3b1a83bbb831fa096b2b7c.zip
gcc-846794ead2982fc85a3b1a83bbb831fa096b2b7c.tar.gz
gcc-846794ead2982fc85a3b1a83bbb831fa096b2b7c.tar.bz2
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.cc (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>
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc
index dfc1129..a622f4c 100644
--- a/gcc/objc/objc-next-runtime-abi-02.cc
+++ b/gcc/objc/objc-next-runtime-abi-02.cc
@@ -1657,6 +1657,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);