Make sure we don't dereference the .end() of the container.
authorBill Wendling <isanbard@gmail.com>
Sat, 21 Feb 2009 01:07:26 +0000 (01:07 +0000)
committerBill Wendling <isanbard@gmail.com>
Sat, 21 Feb 2009 01:07:26 +0000 (01:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65211 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86RegisterInfo.cpp

index 82c15e7caf3ba96746ac71da8b09b25d63cee995..f4ada35e5fb8e9b6217159d3c247eb20556835e7 100644 (file)
@@ -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;