News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about undefined behavior by gpderetta on Tuesday November 29, 2022 @03:41AM (#33785118)
The fact that bar could exit or not return doesn't matter (although it was indeed my initial line of reasoning) as if the value is null bar won't be called and UB happens; hence the value can't be null and bar can be called unconditionally. The value is still dereferenced only after calling bar.

Still gcc doesn't optimize the check away so it is possible there is some other line of reasoning that prevents the transformation.

There are no comments on this comment yet.