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
This commit is contained in:
Bill Wendling 2009-02-21 01:07:26 +00:00
parent 36d3e326df
commit 8aa374b629

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;