From 8aa374b6290210ad86499e129e67dea066d94433 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65211 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; -- 2.34.1