[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
Showing
- docs/UsersManual.rst 3 additions, 1 deletiondocs/UsersManual.rst
- include/clang/Basic/Sanitizers.def 3 additions, 1 deletioninclude/clang/Basic/Sanitizers.def
- lib/CodeGen/CGExprScalar.cpp 37 additions, 26 deletionslib/CodeGen/CGExprScalar.cpp
- test/CodeGen/catch-undef-behavior.c 12 additions, 8 deletionstest/CodeGen/catch-undef-behavior.c
- test/CodeGenCXX/catch-undef-behavior.cpp 9 additions, 5 deletionstest/CodeGenCXX/catch-undef-behavior.cpp
- test/CodeGenCXX/catch-undef-behavior2.cpp 1 addition, 1 deletiontest/CodeGenCXX/catch-undef-behavior2.cpp
- test/Driver/fsanitize.c 11 additions, 8 deletionstest/Driver/fsanitize.c
Loading
Please register or sign in to comment