3 ms·
> The compiler is legally allowed to replace the null dereference with code that sends your porn collection to your mother, and set the reference to 42. Althou
by ahoka 7y ago
> The compiler is legally allowed to replace the null dereference with code that sends your porn collection to your mother, and set the reference to 42.
Although no sane implementation would do this.
- ori_b 7y agoNo, but they may optimize out assigning to the reference at all, since assigning to it requires dereferencing a provably null pointer, which means that any future code is effectively meaningless.
- setr 7y agoThey wouldn't, but they could very well come to a different sane result on a particular architecture than they implementation/architecture you're on. And that would be perfectly compiler-legal, and your code would have one free bug.