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
|
||||
// static for struct slots
|
||||
if (J > 1 && CurTy->isStructTy())
|
||||
return nullptr;
|
||||
if (J > 1) {
|
||||
assert(CurTy && "No current type?");
|
||||
if (CurTy->isStructTy())
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DI = J;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue