From fc5b0503f54faf08ac0994c9d377b8e9ec0078c9 Mon Sep 17 00:00:00 2001 From: hmelder Date: Fri, 7 Nov 2025 10:28:51 +0000 Subject: [PATCH] Cast +load IMP to the correct function signature WebAssembly does a runtime check of the function signature and aborts in case of a mismatch. --- class_table.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/class_table.c b/class_table.c index 3b3d871b..128af53e 100644 --- a/class_table.c +++ b/class_table.c @@ -12,6 +12,8 @@ #include #include +typedef void (*loadIMP)(Class, SEL); + void objc_init_protocols(struct objc_protocol_list *protos); void objc_compute_ivar_offsets(Class class); @@ -54,7 +56,7 @@ PRIVATE void objc_send_load_message(Class class) { if (load_messages_table_get(load_table, m->imp) == 0) { - m->imp((id)class, loadSel); + ((loadIMP)m->imp)(class, loadSel); load_messages_insert(load_table, m->imp); } }