Temporary workaround for an i386 crash in LiveDebugVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp
index 1eab6bb..5e8e309 100644
--- a/lib/CodeGen/LiveDebugVariables.cpp
+++ b/lib/CodeGen/LiveDebugVariables.cpp
@@ -591,7 +591,8 @@
// Don't insert anything after the first terminator.
MachineBasicBlock::iterator Term = MBB->getFirstTerminator();
- if (Term != MBB->end() && Idx >= LIS.getInstructionIndex(Term)) {
+ if (Term != MBB->end() && !LIS.isNotInMIMap(Term) &&
+ Idx >= LIS.getInstructionIndex(Term)) {
DL = Term->getDebugLoc();
return Term;
}