[Issue 9495] New: Win64 vararg issue when first argument is > 8 byte

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 10 09:10:35 PST 2013


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

           Summary: Win64 vararg issue when first argument is > 8 byte
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2013-02-10 09:10:31 PST ---
The following code will crash on Win64 dmd 2.061 and 2.062 beta

import core.vararg;
import std.stdio;

void print(string fmt, ...)
{
  auto arg = va_arg!(const(char)[])(_argptr);
  writefln(fmt ~ arg);
}

void main(string[] args)
{
  print("+++","---");
}


This version will work:
void print(int fmt, ...)
{
  auto arg = va_arg!(const(char)[])(_argptr);
  writefln("%s %s",fmt,arg);
}

void main(string[] args)
{
  print(1,"---");
} 

The only seems to surface when the first argument to a vararg function is
bigger then 8 byte. This is a major blocker for me as it breaks all my string
formatting functions for 64 bit.

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