Fix UB in APInt::ashr
authorJonathan Roelofs <jonathan@codesourcery.com>
Wed, 10 Aug 2016 19:50:14 +0000 (19:50 +0000)
committerJonathan Roelofs <jonathan@codesourcery.com>
Wed, 10 Aug 2016 19:50:14 +0000 (19:50 +0000)
commit851b79dc4d96c6331093d273fdc51eb3c65cb72b
tree052d07c3ecce65c22c82242632b0412deaf5e343
parent9ef6b6b4f4e4004f260563e312036d7be132cfbf
Fix UB in APInt::ashr

i64 -1, whose sign bit is the 0th one, can't be left shifted without invoking UB.

https://reviews.llvm.org/D23362

llvm-svn: 278280
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp