C++26 fixes undefined behavior in trivial infinite loops like while(true); through proposal P2809R3, making them well-defined by replacing the loop body with std::this_thread::yield(). This change addresses a real vulnerability in embedded and kernel code where such loops serve as halt-on-error patterns, preventing compilers from optimizing away the loop and causing execution to fall through into unexpected code.
Kani is a bit-precise model checker for Rust that automatically verifies safety and correctness properties, including undefined behavior detection, panic checks, and arithmetic overflow detection. Users write verification harnesses with symbolic inputs and assertions, and Kani proves all valid inputs satisfy specifications without unexpected behavior.