diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-10-11 09:09:50 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-10-11 09:09:50 +0000 |
commit | 18e7f3569e10382440019d07c5e1376146e46e09 (patch) | |
tree | 20e1f70d4e3a3b155cda8cf1a1f1dc889d15282d /include/clang/Basic/Sanitizers.def | |
parent | 58281c244d412d25880a9b0dfebc6fb88ce55c50 (diff) |
[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks
Summary:
As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`:
* A check when both of the types are unsigned.
* Another check for the other cases (either one of the types is signed, or both of the types is signed).
This is clang part.
Compiler-rt part is D50902.
Reviewers: rsmith, vsk, Sanitizers
Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D50901
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r-- | include/clang/Basic/Sanitizers.def | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def index c3fc1750b7..41bfc064d8 100644 --- a/include/clang/Basic/Sanitizers.def +++ b/include/clang/Basic/Sanitizers.def @@ -135,7 +135,13 @@ SANITIZER_GROUP("undefined", Undefined, SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined) // ImplicitConversionSanitizer -SANITIZER("implicit-integer-truncation", ImplicitIntegerTruncation) +SANITIZER("implicit-unsigned-integer-truncation", + ImplicitUnsignedIntegerTruncation) +SANITIZER("implicit-signed-integer-truncation", ImplicitSignedIntegerTruncation) +SANITIZER_GROUP("implicit-integer-truncation", ImplicitIntegerTruncation, + ImplicitUnsignedIntegerTruncation | + ImplicitSignedIntegerTruncation) + SANITIZER_GROUP("implicit-conversion", ImplicitConversion, ImplicitIntegerTruncation) |