forked from OSchip/llvm-project
Reland '[InstructionCombining] Fixed null check after dereferencing warning. NFCI.'
This commit is contained in:
parent
5b37c018d5
commit
058b5028de
|
@ -1724,8 +1724,11 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||||
|
|
||||||
// The first two arguments can vary for any GEP, the rest have to be
|
// The first two arguments can vary for any GEP, the rest have to be
|
||||||
// static for struct slots
|
// static for struct slots
|
||||||
if (J > 1 && CurTy->isStructTy())
|
if (J > 1) {
|
||||||
return nullptr;
|
assert(CurTy && "No current type?");
|
||||||
|
if (CurTy->isStructTy())
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
DI = J;
|
DI = J;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue