www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22932] New: -vasm: wrong registers shown for calls to C-style

https://issues.dlang.org/show_bug.cgi?id=22932

          Issue ID: 22932
           Summary: -vasm: wrong registers shown for calls to C-style
                    variadic functions
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: disassembler
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

import core.stdc.stdarg;
extern(C) void fn(int, ...) {}
void main()
{
        fn(1, 2, 3, 4, 5);
}

-vasm output on 64-bit linux:

_Dmain:
0000:   55                       push      RBP
0001:   48 8B EC                 mov       RBP,RSP
0004:   41 B8 05 00 00 00        mov       EAX,5
000a:   B9 04 00 00 00           mov       EAX,4
000f:   BA 03 00 00 00           mov       EAX,3
0014:   BE 02 00 00 00           mov       EAX,2
0019:   BF 01 00 00 00           mov       EAX,1
001e:   31 C0                    xor       EAX,EAX
0020:   E8 00 00 00 00           call      L0
0025:   31 C0                    xor       EAX,EAX
0027:   5D                       pop       RBP
0028:   C3                       ret

--
Mar 25 2022