[PATCH] D50250: [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 5 11:57:02 PDT 2018
lebedev.ri updated this revision to Diff 159230.
lebedev.ri added a comment.
Do not emit sign-change check in `signed int -> signed char` case.
The truncation check is sufficient:
https://godbolt.org/g/r1wgQG
https://rise4fun.com/Alive/ifj
The middle-end [clearly] does not understand that,
but since the sign-change is completely unneeded here, it's not a blocker.
The `unsigned int -> signed char` case is the only oh-so-special one,
that needs both the truncation and sign change checks,
but the IR can be significantly improved, will handle that:
https://godbolt.org/g/q7e76x
https://rise4fun.com/Alive/2W8
Repository:
rC Clang
https://reviews.llvm.org/D50250
Files:
docs/ReleaseNotes.rst
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-conversions.c
test/CodeGen/catch-implicit-integer-sign-changes-basics.c
test/CodeGen/catch-implicit-integer-sign-changes-true-negatives.c
test/CodeGen/catch-implicit-integer-sign-changes.c
test/CodeGen/catch-implicit-integer-truncations-basics.c
test/CodeGen/catch-implicit-integer-truncations.c
test/CodeGenCXX/catch-implicit-integer-sign-changes-true-negatives.cpp
test/Driver/fsanitize.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50250.159230.patch
Type: text/x-patch
Size: 94794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180805/9fb7db88/attachment-0001.bin>
More information about the cfe-commits
mailing list