[Issue 16243] New: wrong argument passed with empty struct and 6 integers

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 6 11:38:41 PDT 2016


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

          Issue ID: 16243
           Summary: wrong argument passed with empty struct and 6 integers
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

The bug is OSX-32 only, so not that important (P3), but looks easy to fix.

cat > bug.d << CODE
struct S13956
{
}

extern(C++) void func13956(S13956 arg0, int arg1, int arg2, int arg3, int arg4,
int arg5, int arg6);

extern(C++) void check13956(S13956 arg0, int arg1, int arg2, int arg3, int
arg4, int arg5, int arg6)
{
    assert(arg0 == S13956());
    assert(arg1 == 1);
    assert(arg2 == 2);
    assert(arg3 == 3);
    assert(arg4 == 4);
    assert(arg5 == 5);
    assert(arg6 == 6); // fails on OSX 32-bit
}

void main()
{
    func13956(S13956(), 1, 2, 3, 4, 5, 6);
}
CODE

dmd -m32 -run bug
----

The arg6 parameter is uninitialized (or maybe a pointer).
See disabled test case here
https://github.com/dlang/dmd/pull/5915/commits/6e6c6ed9db5935fb36e9b06e309cea6be7afa9b1.

--


More information about the Digitalmars-d-bugs mailing list