Make sure we don't dereference the .end() of the container.

llvm-svn: 65211
This commit is contained in:
Bill Wendling 2009-02-21 01:07:26 +00:00
parent 3adae91c70
commit 96430050a5

View 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;