Always return 64-bit 0 in response to a message to nil on x86.

main
theraven 14 years ago
parent 6950cb8e55
commit d8192c3a64

@ -57,9 +57,11 @@
jmp *%eax jmp *%eax
4: # returnNil: 4: # returnNil:
.if \fpret .if \fpret
fldz fldz
.else .else
xor %eax, %eax # return 0 (int) xor %eax, %eax # return 0 (int)
xor %edx, %edx # Return 64-bit zero (%edx is
# caller-save, so it's safe to do this in the general case.
.endif .endif
ret ret
5: # slowSend: 5: # slowSend:

@ -9,7 +9,7 @@
void objc_send_initialize(id object); void objc_send_initialize(id object);
static id nil_method(id self, SEL _cmd) { return nil; } static long long nil_method(id self, SEL _cmd) { return 0; }
static struct objc_slot nil_slot = { Nil, Nil, 0, 1, (IMP)nil_method }; static struct objc_slot nil_slot = { Nil, Nil, 0, 1, (IMP)nil_method };

Loading…
Cancel
Save