]> granicus.if.org Git - clang/commit
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 9 Mar 2015 21:50:19 +0000 (21:50 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 9 Mar 2015 21:50:19 +0000 (21:50 +0000)
commit1f820737c86ceb1c35ab448f80d128c95c354814
tree5cf345f4aecf0c557f7f96c825c46bf8eefa5057
parent002c12199fd7e6d2e0e80500223f1d8a92b920a6
[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
docs/UsersManual.rst
include/clang/Basic/Sanitizers.def
lib/CodeGen/CGExprScalar.cpp
test/CodeGen/catch-undef-behavior.c
test/CodeGenCXX/catch-undef-behavior.cpp
test/CodeGenCXX/catch-undef-behavior2.cpp
test/Driver/fsanitize.c