From: Bill Wendling Date: Sat, 21 Feb 2009 01:07:26 +0000 (+0000) Subject: Make sure we don't dereference the .end() of the container. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8aa374b6290210ad86499e129e67dea066d94433;p=oota-llvm.git Make sure we don't dereference the .end() of the container. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65211 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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;