]> granicus.if.org Git - clang/commit
[clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed...
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 11 Oct 2018 09:09:50 +0000 (09:09 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 11 Oct 2018 09:09:50 +0000 (09:09 +0000)
commit18e7f3569e10382440019d07c5e1376146e46e09
tree20e1f70d4e3a3b155cda8cf1a1f1dc889d15282d
parent58281c244d412d25880a9b0dfebc6fb88ce55c50
[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
13 files changed:
docs/UndefinedBehaviorSanitizer.rst
include/clang/Basic/Sanitizers.def
lib/CodeGen/CGExprScalar.cpp
test/CodeGen/catch-implicit-integer-conversions-basics.c
test/CodeGen/catch-implicit-integer-truncations-basics-negatives.c
test/CodeGen/catch-implicit-integer-truncations-basics.c
test/CodeGen/catch-implicit-integer-truncations.c
test/CodeGen/catch-implicit-signed-integer-truncations-basics-negatives.c [new file with mode: 0644]
test/CodeGen/catch-implicit-signed-integer-truncations-basics.c [new file with mode: 0644]
test/CodeGen/catch-implicit-unsigned-integer-truncations-basics-negatives.c [new file with mode: 0644]
test/CodeGen/catch-implicit-unsigned-integer-truncations-basics.c [new file with mode: 0644]
test/CodeGenCXX/catch-implicit-integer-truncations.cpp
test/Driver/fsanitize.c