Bug 2384 – abi spec is unclear on parameter passing
Status
RESOLVED
Resolution
WORKSFORME
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-10-01T19:16:00Z
Last change time
2015-06-09T05:14:41Z
Keywords
spec
Assigned to
bugzilla
Creator
tomas
Comments
Comment #0 by tomas — 2008-10-01T19:16:56Z
the spec says the last parameter is passed in EAX, from just reading the spec it's unclear (to me) what counts as the last parameter.
for example, the 'this' pointer is not passed in EAX even though it's the last thing passed and does fit in EAX
Comment #1 by bugzilla — 2008-10-02T03:41:16Z
'this' is passed last, and in the EAX register. For example,
class A
{
int x;
void foo() { x = 3; }
}
results in:
_D5test51A3fooMFZv comdat
assume CS:_D5test51A3fooMFZv
mov dword ptr 8[EAX],3
ret
_D5test51A3fooMFZv ends