[Issue 21301] Wrong values being passed in long parameter list

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 17 12:13:38 UTC 2022


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl
            Summary|Wrong values being passed   |Wrong values being passed
                   |as variadic arguments       |in long parameter list

--- Comment #1 from Dennis <dkorpel at live.nl> ---
This is not about variadic parameters, it also happens when you spell them out:
```
void main()
{
    void func(
        ubyte p0, ubyte[12] p1, float[3] p2, float p3, float p4, float p5,
float p6,
        float p7, float p8, float p9, float p10, float p11, uint p12, int[]
p13, uint p14
    ) {
        // here args[1] is received as [0, 0, 64, 64, 38, 86, 0, 0, 1, 2, 3, 4]
        assert(p1[0 .. 12] == [1,2,3,4,5,6,7,8,9,10,11,12]);
    }

    func(0,
        cast(ubyte[12])[1,2,3,4,5,6,7,8,9,10,11,12],
        [0, 0, 0],
        0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , uint(0), [], uint(0),
    );
}
```

--


More information about the Digitalmars-d-bugs mailing list