diff --git a/Test/objc_msgSend.m b/Test/objc_msgSend.m index 5e16e1b..35384de 100644 --- a/Test/objc_msgSend.m +++ b/Test/objc_msgSend.m @@ -37,6 +37,7 @@ Class TestCls; int main(void) { TestCls = objc_getClass("Test"); + assert((id)0x42 == objc_msgSend(TestCls, @selector(foo))); objc_msgSend(TestCls, @selector(nothing)); objc_msgSend(TestCls, @selector(missing)); assert(0 == objc_msgSend(0, @selector(nothing))); diff --git a/objc_msgSend.x86-32.S b/objc_msgSend.x86-32.S index 55c32c8..059c219 100644 --- a/objc_msgSend.x86-32.S +++ b/objc_msgSend.x86-32.S @@ -36,12 +36,14 @@ shrl $14, %edx # Right shift 16, but then left shift by 2 (* sizeof(void*)) add %edx, %eax mov (%eax), %eax + mov DATA_OFFSET(%eax), %eax 2: # dtable16: mov %ecx, %edx and $0xff00, %edx shrl $6, %edx add %edx, %eax mov (%eax), %eax + mov DATA_OFFSET(%eax), %eax 3: # dtable8: and $0xff, %ecx shll $2, %ecx