logoalt Hacker News

insanitybit • today at 11:10 AM • 1 reply • view on HN

For a long time `loop {}` was undefined behavior. Lots of l-unsounds are really nuts but a few are not.

The reality is that if this were actually code that people wrote, well, it wouldn't have sat around for a decade.


Replies

masklinn • today at 12:42 PM

Afaik loop {} has never been UB, however because llvm started as a c++ compiled where it is, this has been causing miscompilations in rust and C for… nearly two decades (llvm issue 965).

➕ show 1 reply