2 ms·
UBSan detects (certain types of) undefined behavior at runtime, not compile time. The compiler is involved, as UBSan works by adding checks to the generated as
by comex 7y ago
UBSan detects (certain types of) undefined behavior at runtime, not compile time. The compiler is involved, as UBSan works by adding checks to the generated assembly code: for example, whenever the original code adds two signed integers, the compiler adds code that checks whether overflow occurred, and triggers an error report if so. (Or with this patch, a bell sound!) But the compiler doesn't know ahead of time what the inputs to the addition will be.