|
|
|
|
|
by lmm
1 day ago
|
|
> In general on a system where you trap when accessing the zero page, this optimization should be safe and a null pointer dereferences should (safely) trap. If you mean that C compiler writers "should" prioritise sanity over high scores on microbenchmarks, then I agree. However in practice they do not and this optimization is not remotely safe. |
|
(EDIT: what is not safe is indexing into a null pointer. For this you need to be safe you need -fsanitize=null)