[InstructionCombining] Fixed null check after dereferencing warning. NFCI.

This commit is contained in:
Dávid Bolvanský 2019-11-03 20:10:46 +01:00
parent 8262a5b701
commit 8308187fd9
1 changed files with 1 additions and 0 deletions

View File

@ -1724,6 +1724,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// The first two arguments can vary for any GEP, the rest have to be
// static for struct slots
assert(CurTy && "No current type?");
if (J > 1 && CurTy->isStructTy())
return nullptr;