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 44c0f2aa88
commit 81ebf9a578
1 changed files with 2 additions and 1 deletions

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;