Bug 7735 – Functions with variadic void[][]... arguments corrupt passed data

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-03-19T14:53:00Z
Last change time
2012-03-31T16:54:25Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
pszturmaj

Comments

Comment #0 by pszturmaj — 2012-03-19T14:53:41Z
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.
Comment #1 by pszturmaj — 2012-03-22T07:03:59Z
I checked that last working version was 2.055.
Comment #2 by k.hara.pg — 2012-03-31T05:17:29Z
Comment #3 by github-bugzilla — 2012-03-31T13:14:49Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/87bd259af8e3502c81f4361d28ee7b62bed56a44 fix Issue 7735 - Functions with variadic void[][]... arguments corrupt passed data https://github.com/D-Programming-Language/dmd/commit/b41a2c360f09b83e4de6951f1e7538372319704f Merge pull request #854 from 9rnsr/fix7735 fix Issue 7735 - Functions with variadic void[][]... arguments corrupt passed data