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

           Summary: Functions with variadic void[][]... arguments corrupts
                    passed data
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: psztur...@tlen.pl


--- Comment #0 from Piotr Szturmaj <psztur...@tlen.pl> 2012-03-19 14:53:41 PDT 
---
This program:

import std.stdio;

void a(void[][] data...)
{
    writeln(data);
    b(data);
}

void b(void[][] data...)
{
    writeln(data);
    c(data);
}

void c(void[][] data...)
{
    writeln(data);
}

void main()
{
    a([]);
    a([]);
}

Prints:

[[]]
[[0, 0, 0, 0, 0, 0, 0, 0]]
[[8, 0, 0, 0, 88, 254, 19, 0]]
[[]]
[[0, 0, 0, 0, 0, 0, 0, 0]]
[[8, 0, 0, 0, 104, 254, 19, 0]]

Please note the difference between two a() calls. Also, data written from
within c() looks like array layout - 8 byte length and a pointer.

Tested with 2.059head and 32-bit Windows XP.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to