[Issue 9931] Bus error interfacing with C function returning structs with floats
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 16 17:57:27 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9931
--- Comment #7 from Martin Nowak <code at dawg.eu> 2013-04-16 17:57:26 PDT ---
Seems like OSX deviates from the SysV IA-32 ABI for memory struct returns.
The callee does NOT return the hidden pointer in EAX.
Instead the caller has to use the value passed as argument.
0x0000267c <D4test3barFZS4test3Foo+20>: call 0x26a0 <foo>
0x00002681 <D4test3barFZS4test3Foo+25>: add $0xc,%esp
0x00002684 <D4test3barFZS4test3Foo+28>: mov %eax,%esi // <- EAX is trashed
0x00002686 <D4test3barFZS4test3Foo+30>: mov -0x4(%ebp),%edi
0x00002689 <D4test3barFZS4test3Foo+33>: movsl %ds:(%esi),%es:(%edi)
0x0000268a <D4test3barFZS4test3Foo+34>: movsl %ds:(%esi),%es:(%edi)
0x0000268b <D4test3barFZS4test3Foo+35>: movsl %ds:(%esi),%es:(%edi)
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list