From 96430050a586a41da702506b5df0b7dd74f90ffe Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sat, 21 Feb 2009 01:07:26 +0000 Subject: [PATCH] Make sure we don't dereference the .end() of the container. llvm-svn: 65211 --- lib/Target/X86/X86RegisterInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 82c15e7caf3..f4ada35e5fb 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;