aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86RegisterInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 82c15e7caf..f4ada35e5f 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -728,7 +728,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) ||
!Fn->doesNotThrow() ||
UnwindTablesMandatory;
- DebugLoc DL = MBBI->getDebugLoc();
+ DebugLoc DL = (MBBI != MBB.end()) ? MBBI->getDebugLoc() :
+ DebugLoc::getUnknownLoc();
// Prepare for frame info.
unsigned FrameLabelId = 0;