]> granicus.if.org Git - clang/commit
[ubsan] Detect signed overflow UB in remainder operations
authorVedant Kumar <vsk@apple.com>
Sat, 25 Feb 2017 00:43:39 +0000 (00:43 +0000)
committerVedant Kumar <vsk@apple.com>
Sat, 25 Feb 2017 00:43:39 +0000 (00:43 +0000)
commitd9ca335a547ef2193420e49e1ba5c6b3cefd87ca
tree54ffc045b8be230fc7880a33f329655aaad4c8cd
parent2b6e4a436d728e605bd68c6c3f06aedfb3825bf8
[ubsan] Detect signed overflow UB in remainder operations

Teach ubsan to diagnose remainder operations which have undefined
behavior due to signed overflow (e.g INT_MIN % -1).

Differential Revision: https://reviews.llvm.org/D29437

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296214 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprScalar.cpp
test/CodeGen/ubsan-promoted-arith.cpp