diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-09 21:50:19 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-09 21:50:19 +0000 |
commit | 1f820737c86ceb1c35ab448f80d128c95c354814 (patch) | |
tree | 5cf345f4aecf0c557f7f96c825c46bf8eefa5057 /include/clang/Basic/Sanitizers.def | |
parent | 002c12199fd7e6d2e0e80500223f1d8a92b920a6 (diff) |
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
This is a recommit of r231150, reverted in r231409. Turns out
that -fsanitize=shift-base check implementation only works if the
shift exponent is valid, otherwise it contains undefined behavior
itself.
Make sure we check that exponent is valid before we proceed to
check the base. Make sure that we actually report invalid values
of base or exponent if -fsanitize=shift-base or
-fsanitize=shift-exponent is specified, respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r-- | include/clang/Basic/Sanitizers.def | 4 |
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) |