News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about undefined behavior by tsimionescu on Monday November 28, 2022 @07:43AM (#33772909)
That's sounds plausible, but isn't. First of all, out-of-order execution has nothing to do with unreachable core - it just means that reachable code sometimes gets executed in a different order than the binary shows. It is speculative execution which can lead to unreachable code actually being executed.

However, even when processors execute code speculatively, they guarantee that no observable effects of executing that code will happen. So, if you have something like `if false {*NULL=7/0}`, the processor might attempt to execute that line speculatively, but it will revert any change it made, and it will not trap regardless of any other flags.

There are no comments on this comment yet.