Y
Hacker News
new
|
ask
|
show
|
jobs
by
Measter
224 days ago
Only if that memory page is unmapped, and only if the optimizer doesn't detect that it's a null pointer and start deleting verification code because derefing null is UB, and UB is assumed to never happen.
1 comments
charlie90
223 days ago
How common is this in practice?
link
adrianN
223 days ago
Compilers regularly delete null pointer checks when they can see that the pointer is dereferenced.
link
Smaug123
223 days ago
(GCC controls this with `-fno-delete-null-pointer-checks`
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#ind...
)
link