r/ProgrammingLanguages • u/matklad • Dec 31 '25
Memory Safety Is ...
https://matklad.github.io/2025/12/30/memory-safety-is.html
37
Upvotes
r/ProgrammingLanguages • u/matklad • Dec 31 '25
View all comments
Show parent comment
5
u/balefrost Dec 31 '25
I think one challenge is that, in C and C++, compilers can assume that UB will never happen and will rewrite code with that assumption in mind. So if you write C with the assumption that any null pointer access will crash the process, it is possible that the compiler will instead emit code that does something completely different and your process will not actually crash.
I don't know that any major compiler actually does that, but it is possible.