From 4b53a7bdf9631570bade0ebe50246fc32413618a Mon Sep 17 00:00:00 2001 From: Paul Olteanu <170131110+cmpwi@users.noreply.github.com> Date: Sun, 28 Jun 2026 11:55:14 -0400 Subject: [PATCH] Return forwarding hook instead of calling it with no receiver if method isn't found --- sendmsg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendmsg2.c b/sendmsg2.c index 4ffdebd2..8e8632be 100644 --- a/sendmsg2.c +++ b/sendmsg2.c @@ -431,7 +431,7 @@ IMP class_getMethodImplementation(Class cls, SEL name) { if ((Nil == cls) || (NULL == name)) { return (IMP)0; } struct objc_slot2 * slot = objc_get_slot2(cls, name, NULL); - return NULL != slot ? slot->method : __objc_msg_forward2(nil, name); + return NULL != slot ? slot->method : (IMP)__objc_msg_forward2; } IMP class_getMethodImplementation_stret(Class cls, SEL name)