logoalt Hacker News

secondcomingyesterday at 9:05 PM1 replyview on HN

Let's not vague post on HN. What's the problem with the above?


Replies

saagarjhatoday at 12:34 AM

The problem is the code unconditionally dereferences the pointer, which would be UB if it was a null pointer. This means it is legal to optimize out any code paths that rely on this, even if they occur earlier in program order.

show 3 replies