[InstructionCombining] Fixed null check after dereferencing warning. NFCI.
authorDávid Bolvanský <david.bolvansky@gmail.com>
Sun, 3 Nov 2019 19:10:46 +0000 (20:10 +0100)
committerDávid Bolvanský <david.bolvansky@gmail.com>
Sun, 3 Nov 2019 19:10:46 +0000 (20:10 +0100)
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

index c4f9be0..897c29e 100644 (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;