summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/Sanitizers.def
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-13 07:11:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-13 07:11:50 +0000
commit463b48ba7eab6d7c96d23b59caea7f25de548293 (patch)
tree6b55f8068dd1c79805b0ecfcaadec1b26c8c0946 /include/clang/Basic/Sanitizers.def
parentcdc2e82c317163693c99a8cbef76685e86420395 (diff)
ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
bit-patterns which are not valid values for enumerated or boolean types. These checks are the ubsan analogue of !range metadata. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r--include/clang/Basic/Sanitizers.def9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def
index 57ca6eb185..3e02b3ac14 100644
--- a/include/clang/Basic/Sanitizers.def
+++ b/include/clang/Basic/Sanitizers.def
@@ -56,7 +56,9 @@ SANITIZER("thread", Thread)
// UndefinedBehaviorSanitizer
SANITIZER("alignment", Alignment)
+SANITIZER("bool", Bool)
SANITIZER("bounds", Bounds)
+SANITIZER("enum", Enum)
SANITIZER("float-cast-overflow", FloatCastOverflow)
SANITIZER("float-divide-by-zero", FloatDivideByZero)
SANITIZER("integer-divide-by-zero", IntegerDivideByZero)
@@ -76,9 +78,10 @@ SANITIZER("unsigned-integer-overflow", UnsignedIntegerOverflow)
// include all the sanitizers which have low overhead, no ABI or address space
// layout implications, and only catch undefined behavior.
SANITIZER_GROUP("undefined", Undefined,
- Alignment | Bounds | FloatCastOverflow | FloatDivideByZero |
- IntegerDivideByZero | Null | ObjectSize | Return | Shift |
- SignedIntegerOverflow | Unreachable | VLABound | Vptr)
+ Alignment | Bool | Bounds | Enum | FloatCastOverflow |
+ FloatDivideByZero | IntegerDivideByZero | Null | ObjectSize |
+ Return | Shift | SignedIntegerOverflow | Unreachable |
+ VLABound | Vptr)
SANITIZER_GROUP("integer", Integer,
SignedIntegerOverflow | UnsignedIntegerOverflow | Shift |