dip1000 and preview in combine to cause extra safety errors

deadalnix deadalnix at gmail.com
Wed Jun 8 17:22:37 UTC 2022


On Wednesday, 8 June 2022 at 17:09:49 UTC, Mathias LANG wrote:
> And you'll see the bug, even without `-preview=dip1000`.
>
> Why is this happening ? You correctly guessed, because the 
> frontend wrongfully lets the `string` go on the stack instead 
> of allocating with it.
>
> Some of the changes for DIP1000 made it to releases even 
> without the switch, that's one example.

No, promoting the array on stack is not sufficient to explain the 
behavior - thought it is certainly part of it.

The compiler is going out of his way in some other way to break 
the code.


More information about the Digitalmars-d mailing list