mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-04 18:06:49 +00:00
Use a utility from MathExtras to clarify a check and avoid undefined behavior. Based on patch by Ahmed Charles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
95f8db4d4d
commit
5c75af6eb7
@ -1679,7 +1679,7 @@ void SelectionDAGBuilder::visitBitTestHeader(BitTestBlock &B,
|
||||
UsePtrType = true;
|
||||
else {
|
||||
for (unsigned i = 0, e = B.Cases.size(); i != e; ++i)
|
||||
if ((uint64_t)((int64_t)B.Cases[i].Mask >> VT.getSizeInBits()) + 1 >= 2) {
|
||||
if (!isUIntN(VT.getSizeInBits(), B.Cases[i].Mask)) {
|
||||
// Switch table case range are encoded into series of masks.
|
||||
// Just use pointer type, it's guaranteed to fit.
|
||||
UsePtrType = true;
|
||||
|
Loading…
Reference in New Issue
Block a user