forked from OSchip/llvm-project
Use a utility from MathExtras to clarify a check and avoid undefined behavior. Based on patch by Ahmed Charles.
llvm-svn: 141829
This commit is contained in:
parent
000721f058
commit
979009ea61
|
@ -1679,7 +1679,7 @@ void SelectionDAGBuilder::visitBitTestHeader(BitTestBlock &B,
|
||||||
UsePtrType = true;
|
UsePtrType = true;
|
||||||
else {
|
else {
|
||||||
for (unsigned i = 0, e = B.Cases.size(); i != e; ++i)
|
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.
|
// Switch table case range are encoded into series of masks.
|
||||||
// Just use pointer type, it's guaranteed to fit.
|
// Just use pointer type, it's guaranteed to fit.
|
||||||
UsePtrType = true;
|
UsePtrType = true;
|
||||||
|
|
Loading…
Reference in New Issue