Commit 058b5028 authored by Dávid Bolvanský's avatar Dávid Bolvanský
Browse files

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

parent 5b37c018
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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())
            if (J > 1) {
              assert(CurTy && "No current type?");
              if (CurTy->isStructTy())
                return nullptr;
            }

            DI = J;
          } else {