Comment #0 by john.loughran.colvin — 2020-12-27T13:02:13Z
immutable ex = new Exception("fdsa");
void main() {
import std.stdio : writeln;
import core.stdc.stdlib : alloca;
auto a = (cast(long*)alloca(8))[0..1];
try {
throw ex;
} catch (Exception) { }
a[0] = 3;
writeln(a[0]); // 3
writeln(*(a.ptr)); // something else, looks like an address of somewhere on the stack?
}
LDC does the right thing and prints 3 both times.
For future readers: please be careful about closing this as "works for me", because it's not a very stable bug. E.g. putting asserts in to check for 3 pass if the writelns aren't there!
Comment #1 by robert.schadek — 2024-12-13T19:13:41Z