diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-02-21 01:11:36 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-02-21 01:11:36 +0000 |
commit | 82aa14fae81259da4d9bedf4d0b25c0c08fe7a54 (patch) | |
tree | 61caceeeb1f09db100c61e3ccfd6ee1b8c55bf96 /llvm/lib/Target | |
parent | 6f2613131689b6041c675f801c2e7356e8d57be8 (diff) | |
download | bcm5719-llvm-82aa14fae81259da4d9bedf4d0b25c0c08fe7a54.tar.gz bcm5719-llvm-82aa14fae81259da4d9bedf4d0b25c0c08fe7a54.zip |
Make sure this doesn't access .end() too.
llvm-svn: 65213
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index f4ada35e5fb..16662b05165 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -542,7 +542,8 @@ void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) : (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri)); uint64_t Chunk = (1LL << 31) - 1; - DebugLoc DL = MBBI->getDebugLoc(); + DebugLoc DL = (MBBI != MBB.end() ? MBBI->getDebugLoc() : + DebugLoc::getUnknownLoc()); while (Offset) { uint64_t ThisVal = (Offset > Chunk) ? Chunk : Offset; @@ -728,8 +729,8 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || !Fn->doesNotThrow() || UnwindTablesMandatory; - DebugLoc DL = (MBBI != MBB.end()) ? MBBI->getDebugLoc() : - DebugLoc::getUnknownLoc(); + DebugLoc DL = (MBBI != MBB.end() ? MBBI->getDebugLoc() : + DebugLoc::getUnknownLoc()); // Prepare for frame info. unsigned FrameLabelId = 0; |