[Issue 10678] New: Win64: wrong code passing small fixed sized array as function argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 20 02:02:51 PDT 2013


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

           Summary: Win64: wrong code passing small fixed sized array as
                    function argument
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-07-20 02:02:45 PDT ---
extracted from std.format unittests:

////////////////////////////////////
enum size = 5;

char[size] ret()
{
    char[size] hello = "hello world"[0..size];
    return hello;
}

void test(char[size] txt)
{
    assert(txt == "hello world"[0..size]); // fails
}

void main() 
{
    auto r = ret();
    assert(r == "hello world"[0..size]); // passes

    test(r);
}
/////////////////////////////////////

compile with "dmd -m64 test.d" to trigger the assertion. This happens for array
sizes 5, 6 and 7.

This might be related to issue 9586.

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