diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 1a4396bace35..7f2cab96ec55 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -12419,6 +12419,8 @@ static void AddReachableCodeToWorklist(BasicBlock *BB, DBI_Prev->eraseFromParent(); } DBI_Prev = DBI_Next; + } else { + DBI_Prev = 0; } IC.AddToWorkList(Inst);