4 ms·
We compile D with LLVM. Null pointer access is defined to crash, unlike C/C++ where it is undefined.
by nicwilson 9y ago
We compile D with LLVM. Null pointer access is defined to crash, unlike C/C++ where it is undefined.
- pcwalton 9y agoAre you adding explicit checks (possibly using fault maps to optimize them)? Because if not, you're depending on undefined behavior.
- nicwilson 9y agoThat is only necessary for single objects that are bigger than one page which, we dont currently do (but should). Arrays are no problem since we check the bounds, only raw pointers cause problems.
- pcwalton 9y agoNo, it is necessary in all cases. Look at the InstCombine code I linked in a sibling comment…