UndefinedBehaviorSanitizer Clang 10 - ostash/sanitizer-docs GitHub Wiki
UndefinedBehaviorSanitizer checks
It is actually set of smaller sanitizers, which can be used independently or in groups (undefined, nullability, shift, implicit-integer-truncation, implicit-integer-arithmetic-value-change, implicit-conversion, integer, bounds).
Recover and Trap columns show whether sanitizer can be used with -fsanitize-recover
and -fsanitize-trap
.
Sanitizer | undefined | Groups | Recover | Trap |
---|---|---|---|---|
alignment | X | - | Default | Yes |
array-bounds | X | bounds | Default | Yes |
bool | X | - | Default | Yes |
builtin | X | - | Default | Yes |
enum | X | - | Default | Yes |
float-cast-overflow | X | - | Default | Yes |
float-divide-by-zero | - | - | Default | Yes |
function | X | - | Default | Yes |
integer-divide-by-zero | X | integer | Default | Yes |
nonnull-attribute | X | - | Default | Yes |
null | X | - | Default | Yes |
nullability-arg | - | nullability | Default | Yes |
nullability-assign | - | nullability | Default | Yes |
nullability-return | - | nullability | Default | Yes |
object-size | X | - | Default | Yes |
pointer-overflow | X | - | Default | Yes |
return | X | - | NO | Yes |
returns-nonnull-attribute | X | - | Default | Yes |
shift-base | X | shift,integer | Default | Yes |
shift-exponent | X | shift,integer | Default | Yes |
signed-integer-overflow | X | integer | Default | Yes |
unreachable | X | - | NO | Yes |
vla-bound | X | - | Default | Yes |
vptr | X | - | Default | NO |
unsigned-integer-overflow | - | integer | Default | Yes |
implicit-unsigned-integer-truncation | - | implicit-integer-truncation,implicit-conversion,integer | Default | Yes |
implicit-signed-integer-truncation | - | implicit-integer-truncation,implicit-integer-arithmetic-value-change,implicit-conversion,integer | Default | Yes |
implicit-integer-sign-change | - | implicit-integer-arithmetic-value-change,implicit-conversion,integer | Default | Yes |
local-bounds | - | bounds | Yes | Yes |
LLVM options
local-bounds
Type | Name | Default value | Description |
---|---|---|---|
bool | bounds-checking-single-trap | false (?) | Use one trap block per function |