[Issue 5698] va_arg sets wrong length for (u)short[]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 15 02:11:17 PDT 2011


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2011-03-15 02:04:42 PDT ---
When I compile the test code on D2 Windows (replacing tango.stdc.stdarg ->
core.stdc.stdarg), I just get indication of memory corruption:

vararg_:
ubyte[].length = 18419671623532547
ushort[].length = 18419809062486019
short[].length = 18419860602093571
uint[].length = 18419912141701123


There's this code in the test case:

   T[] usa;
    va_arg(ap, _arguments[0],cast(void*) &usa); 

Are you sure this is correct? Looks wrong to me, remember that static arrays
are passed by value.

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