cmake: add option ENABLE_UB_SANITIZER
Clang has a built-in sanitizer for undefined behaviour. Such as wrong memory alignment, array boundaries violation, 0 division, bool values with non standard content, etc. The sanitizer emits runtime checks which lead to either crash, or a trap, or a warning print, depending on what is chosen. The patch makes it possible to turn the sanitizer on and catch UBs. The only supported UB so far is alignment check. Other types can be added gradually, along with fixing bugs which they find. The UB sanitizer is activated for ASAN builds in CI. Part of #4609
Loading
Please register or sign in to comment