aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMFrameLowering.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2015-10-15 00:41:26 +0000
committerQuentin Colombet <qcolombet@apple.com>2015-10-15 00:41:26 +0000
commit5084e44d71a24646be5105601105295f8fbaf282 (patch)
tree16a75f98e0d23fd5dd566cbf14b66ff41152bef7 /llvm/lib/Target/ARM/ARMFrameLowering.cpp
parent276332b47fc2f65feb46b762e2f0dfd3014ace35 (diff)
downloadllvm-5084e44d71a24646be5105601105295f8fbaf282.zip
llvm-5084e44d71a24646be5105601105295f8fbaf282.tar.gz
llvm-5084e44d71a24646be5105601105295f8fbaf282.tar.bz2
[ARM] Make sure we do not dereference the end iterator when accessing debug
information. Although the problem was always here, it would only be exposed when shrink-wrapping is enable. rdar://problem/23110493 llvm-svn: 250352
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 802946a..f0f077e 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -1060,7 +1060,7 @@ static void emitAlignedDPRCS2Spills(MachineBasicBlock &MBB,
const TargetRegisterInfo *TRI) {
MachineFunction &MF = *MBB.getParent();
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- DebugLoc DL = MI->getDebugLoc();
+ DebugLoc DL = MI != MBB.end() ? MI->getDebugLoc() : DebugLoc();
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
MachineFrameInfo &MFI = *MF.getFrameInfo();
@@ -1220,7 +1220,7 @@ static void emitAlignedDPRCS2Restores(MachineBasicBlock &MBB,
const TargetRegisterInfo *TRI) {
MachineFunction &MF = *MBB.getParent();
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- DebugLoc DL = MI->getDebugLoc();
+ DebugLoc DL = MI != MBB.end() ? MI->getDebugLoc() : DebugLoc();
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
// Find the frame index assigned to d8.