1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-09 05:19:16 -04:00
ports/devel/llvm29/files/patch-lib_Transforms_Scalar_LoopIndexSplit.cpp
Brooks Davis b76df69100 Upgrade to LLVM 2.1, the latest release.
A couple patchs are included from HEAD that didn't make the release, but
fix use-after-free bugs.

Submitted by:	Emil Mikulic <emil at cs dot rmit dot edu dot au>
2007-09-28 15:24:14 +00:00

21 lines
685 B
C++

Author: dpatel
Date: Thu Sep 20 18:01:50 2007
New Revision: 42178
Log:
Don't increment invalid iterator.
==============================================================================
--- lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ lib/Transforms/Scalar/LoopIndexSplit.cpp Thu Sep 20 18:01:50 2007
@@ -928,8 +928,9 @@
while (!WorkList.empty()) {
BasicBlock *BB = WorkList.back(); WorkList.pop_back();
for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end();
- BBI != BBE; ++BBI) {
+ BBI != BBE; ) {
Instruction *I = BBI;
+ ++BBI;
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
}