diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-22 22:51:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-22 22:51:04 +0000 |
commit | 69170e6e41e72c84fe5303540c1aa7ca9944ff18 (patch) | |
tree | 22cf7eafe04333f6d61b695e3ac929ee598af26b /include/clang/Basic/Sanitizers.def | |
parent | 255ca71082810ac8d3084f43727675e02a384683 (diff) |
Split -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end
check which inserts traps).
Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce
useful diagnostics and has false positives (PR17635), and is not a good
compromise position between UBSan's checks and ASan's checks.
Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical
behavior for that flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r-- | include/clang/Basic/Sanitizers.def | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def index a889b9ad4f..c9b31a39aa 100644 --- a/include/clang/Basic/Sanitizers.def +++ b/include/clang/Basic/Sanitizers.def @@ -59,8 +59,8 @@ SANITIZER("leak", Leak) // UndefinedBehaviorSanitizer SANITIZER("alignment", Alignment) +SANITIZER("array-bounds", ArrayBounds) SANITIZER("bool", Bool) -SANITIZER("bounds", Bounds) SANITIZER("enum", Enum) SANITIZER("float-cast-overflow", FloatCastOverflow) SANITIZER("float-divide-by-zero", FloatDivideByZero) @@ -84,7 +84,7 @@ SANITIZER("dataflow", DataFlow) // -fsanitize=undefined includes all the sanitizers which have low overhead, no // ABI or address space layout implications, and only catch undefined behavior. SANITIZER_GROUP("undefined", Undefined, - Alignment | Bool | Bounds | Enum | FloatCastOverflow | + Alignment | Bool | ArrayBounds | Enum | FloatCastOverflow | FloatDivideByZero | Function | IntegerDivideByZero | Null | ObjectSize | Return | Shift | SignedIntegerOverflow | Unreachable | VLABound | Vptr) @@ -94,7 +94,7 @@ SANITIZER_GROUP("undefined", Undefined, // runtime support. This group is generally used in conjunction with the // -fsanitize-undefined-trap-on-error flag. SANITIZER_GROUP("undefined-trap", UndefinedTrap, - Alignment | Bool | Bounds | Enum | FloatCastOverflow | + Alignment | Bool | ArrayBounds | Enum | FloatCastOverflow | FloatDivideByZero | IntegerDivideByZero | Null | ObjectSize | Return | Shift | SignedIntegerOverflow | Unreachable | VLABound) @@ -103,5 +103,9 @@ SANITIZER_GROUP("integer", Integer, SignedIntegerOverflow | UnsignedIntegerOverflow | Shift | IntegerDivideByZero) +// -fbounds-checking +SANITIZER("local-bounds", LocalBounds) +SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds) + #undef SANITIZER #undef SANITIZER_GROUP |