dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Null pointer dereference in `@safe` can be optimized away

Open limepoutine opened this issue 1 month ago • 1 comments

Follow-up of #22113. The spec explicitly disallows optimizing away null pointer dereference. However, all DMD versions on run.dlang.io optimize away &(*null).

#22113 is implemented to not change previous behavior, but I think taking the address of *null should result in a segfault.

limepoutine avatar Nov 20 '25 07:11 limepoutine

Nice

xavierfingers avatar Nov 21 '25 01:11 xavierfingers