summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/Sanitizers.def
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-03-03 22:15:35 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-03-03 22:15:35 +0000
commit6cb698a584b64e3d9b4df022fcb70504b0c33348 (patch)
treeae0ac037ed5035426b792f7cfc424328ccd030f9 /include/clang/Basic/Sanitizers.def
parentb79099a8d86c8420bba56e01abbf27baa6c03639 (diff)
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
-fsanitize=shift is now a group that includes both these checks, so exisiting users should not be affected. This change introduces two new UBSan kinds that sanitize only left-hand side and right-hand side of shift operation. In practice, invalid exponent value (negative or too large) tends to cause more portability problems, including inconsistencies between different compilers, crashes and inadequeate results on non-x86 architectures etc. That is, -fsanitize=shift-exponent failures should generally be addressed first. As a bonus, this change simplifies CodeGen implementation for emitting left shift (separate checks for base and exponent are now merged by the existing generic logic in EmitCheck()), and LLVM IR for these checks (the number of basic blocks is reduced). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r--include/clang/Basic/Sanitizers.def4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def
index 1595c753cb..cded80a9cf 100644
--- a/include/clang/Basic/Sanitizers.def
+++ b/include/clang/Basic/Sanitizers.def
@@ -64,7 +64,9 @@ SANITIZER("null", Null)
SANITIZER("object-size", ObjectSize)
SANITIZER("return", Return)
SANITIZER("returns-nonnull-attribute", ReturnsNonnullAttribute)
-SANITIZER("shift", Shift)
+SANITIZER("shift-base", ShiftBase)
+SANITIZER("shift-exponent", ShiftExponent)
+SANITIZER_GROUP("shift", Shift, ShiftBase | ShiftExponent)
SANITIZER("signed-integer-overflow", SignedIntegerOverflow)
SANITIZER("unreachable", Unreachable)
SANITIZER("vla-bound", VLABound)