[Issue 6758] New: std.c.stdarg problems with 8 or more integer arguments on x86_64

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 2 04:11:23 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6758

           Summary: std.c.stdarg problems with 8 or more integer arguments
                    on x86_64
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: grahamc001uk at yahoo.co.uk


--- Comment #0 from Graham <grahamc001uk at yahoo.co.uk> 2011-10-02 04:10:43 PDT ---
When there are 8 or more integer (not float or double) arguments to a vararg
function as well as string arguments va_arg() appears to get some wrong
argument details.

This problem is present on both the D1 and D2 compilers.

Code works fine with 32 bit compilation. Only a problem with 64 bit
compilation.

Example code attached. This might also seg fault in some circumstances.

This displays (see incorrect information for arguments 9 and 10 in the first
section):

9 variable arguments
argument types [int, int, int, int, int, int, int, immutable(char)[],
immutable(char)[]]
2) int arg = 2
3) int arg = 3
4) int arg = 4
5) int arg = 5
6) int arg = 6
7) int arg = 7
8) int arg = 8
9) string arg = '', length 0
10) string arg = '?', length 4764008
9 variable arguments
argument types [double, int, int, int, int, int, int, immutable(char)[],
immutable(char)[]]
2) double arg = 2.000000
3) int arg = 3
4) int arg = 4
5) int arg = 5
6) int arg = 6
7) int arg = 7
8) int arg = 8
9) string arg = '9', length 1
10) string arg = '10', length 2
9 variable arguments
argument types [int, int, int, int, int, int, immutable(char)[],
immutable(char)[], immutable(char)[]]
2) int arg = 2
3) int arg = 3
4) int arg = 4
5) int arg = 5
6) int arg = 6
7) int arg = 7
8) string arg = '8', length 1
9) string arg = '9', length 1
10) string arg = '10', length 2
9 variable arguments
argument types [immutable(char)[], int, int, int, int, int, int,
immutable(char)[], immutable(char)[]]
2) string arg = '2', length 1
3) int arg = 3
4) int arg = 4
5) int arg = 5
6) int arg = 6
7) int arg = 7
8) int arg = 8
9) string arg = '9', length 1
10) string arg = '10', length 2

-- 
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