www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24440] New: multiple multidimensional array appends broke in

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

          Issue ID: 24440
           Summary: multiple multidimensional array appends broke in 2.107
                    on Windows
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: gassa mail.ru

Reduced example:

```
immutable int n = 500;
void main() {
        auto a = new long [] [] [] (n, n);
        foreach (i; 0..n * 4)
                foreach (j; 0..n)
                        a[j][0] ~= 0;
        assert(false);
}
```

Compile string (Windows):
`dmd -m32 -g reg107.d`
or
`dmd -m64 -g reg107.d`

Expected behavior (works in 2.106.0):
The program correctly goes to `assert(false)` and halts there.
This way is used instead of debug output to avoid libraries.

Issue (in 2.107.0, 2.107.1, and 2.108.0-rc1):
The Win32 build breaks with:
```
object.Error (0): Win32 Exception
----------------
0x740CF41C in wcslen
0x00401101 in D main at C:\programs\stuff\dmd\reg107.d(6)
0x004042CF in void rt.dmain2._d_run_main2(char[][], uint, extern (C) int
function(char[][])*).runAll().__lambda2()
...
```

The Win64 build just breaks silently.

Issue was reported on Linux too, but I can't check there at the moment.

--
Mar 17