forked from OSchip/llvm-project
[X86] Don't dereference a dyn_cast<> - use a cast<> instead. NFCI.
dyn_cast<> can return null if the cast fails, by using cast<> we assert that the cast is correct helping to avoid a potential null dereference.
This commit is contained in:
parent
6052a8a535
commit
41587466aa
|
@ -44378,8 +44378,7 @@ static SDValue combineAndLoadToBZHI(SDNode *Node, SelectionDAG &DAG,
|
|||
uint64_t ArrayElementCount = Init->getType()->getArrayNumElements();
|
||||
bool ConstantsMatch = true;
|
||||
for (uint64_t j = 0; j < ArrayElementCount; j++) {
|
||||
ConstantInt *Elem =
|
||||
dyn_cast<ConstantInt>(Init->getAggregateElement(j));
|
||||
auto *Elem = cast<ConstantInt>(Init->getAggregateElement(j));
|
||||
if (Elem->getZExtValue() != (((uint64_t)1 << j) - 1)) {
|
||||
ConstantsMatch = false;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue