[Issue 23170] Array literal passed to map in lambda, then returned from nested function, is memory corrupted
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 7 15:53:22 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23170
--- Comment #2 from FeepingCreature <default_357-line at yahoo.de> ---
Even weirder reproduction!
void main()
{
test(({ return badAlias([1, 2, 3]); })());
}
void test(int[] array)
{
assert(array[0] == 1);
assert(array[1] == 2);
assert(array[2] == 3);
}
alias badAlias = (int[] array) => id(array);
int[] id(int[] array) { return array; }
--
More information about the Digitalmars-d-bugs
mailing list