Bug fix x86-32...

main
theraven 14 years ago
parent fb1d76ceaa
commit 3df41cba81

@ -37,6 +37,7 @@ Class TestCls;
int main(void) int main(void)
{ {
TestCls = objc_getClass("Test"); TestCls = objc_getClass("Test");
assert((id)0x42 == objc_msgSend(TestCls, @selector(foo)));
objc_msgSend(TestCls, @selector(nothing)); objc_msgSend(TestCls, @selector(nothing));
objc_msgSend(TestCls, @selector(missing)); objc_msgSend(TestCls, @selector(missing));
assert(0 == objc_msgSend(0, @selector(nothing))); assert(0 == objc_msgSend(0, @selector(nothing)));

@ -36,12 +36,14 @@
shrl $14, %edx # Right shift 16, but then left shift by 2 (* sizeof(void*)) shrl $14, %edx # Right shift 16, but then left shift by 2 (* sizeof(void*))
add %edx, %eax add %edx, %eax
mov (%eax), %eax mov (%eax), %eax
mov DATA_OFFSET(%eax), %eax
2: # dtable16: 2: # dtable16:
mov %ecx, %edx mov %ecx, %edx
and $0xff00, %edx and $0xff00, %edx
shrl $6, %edx shrl $6, %edx
add %edx, %eax add %edx, %eax
mov (%eax), %eax mov (%eax), %eax
mov DATA_OFFSET(%eax), %eax
3: # dtable8: 3: # dtable8:
and $0xff, %ecx and $0xff, %ecx
shll $2, %ecx shll $2, %ecx

Loading…
Cancel
Save