diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-25 23:14:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-25 23:14:54 +0000 |
commit | acbdf53db415bae448df53e19a74db3d5b7dc8be (patch) | |
tree | b47782a2b8cb2a79475c68d1dede1aa7d979626f /llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp | |
parent | c34befc78fc9f9a93ca6043814d9f8b53e1fccc3 (diff) | |
download | llvm-acbdf53db415bae448df53e19a74db3d5b7dc8be.zip llvm-acbdf53db415bae448df53e19a74db3d5b7dc8be.tar.gz llvm-acbdf53db415bae448df53e19a74db3d5b7dc8be.tar.bz2 |
Thumb2ITBlockPass: Fix a possible dereference of an invalid iterator. This was
introduced in r106343, but only showed up recently (with a particular compiler &
linker combination) because of the particular check, and because we have no
builtin checking for dereferencing the end of an array, which is truly
unfortunate.
llvm-svn: 106908
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp index 57f8eec..417059d 100644 --- a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp +++ b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp @@ -310,9 +310,9 @@ Thumb2ITBlockPass::MoveCopyOutOfITBlock(MachineInstr *MI, // If not, then there is nothing to be gained by moving the copy. MachineBasicBlock::iterator I = MI; ++I; MachineBasicBlock::iterator E = MI->getParent()->end(); + while (I != E && I->isDebugValue()) + ++I; if (I != E) { - while (I != E && I->isDebugValue()) - ++I; unsigned NPredReg = 0; ARMCC::CondCodes NCC = llvm::getITInstrPredicate(I, NPredReg); if (NCC == CC || NCC == OCC) |