[llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 5 08:34:24 PDT 2005



Changes in directory llvm/lib/VMCore:

BasicBlock.cpp updated: 1.66 -> 1.67
---
Log message:

Fix an iterator invalidation problem when we decide a phi has a constant value


---
Diffs of the changes:  (+2 -1)

 BasicBlock.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.66 llvm/lib/VMCore/BasicBlock.cpp:1.67
--- llvm/lib/VMCore/BasicBlock.cpp:1.66	Thu Aug  4 20:02:04 2005
+++ llvm/lib/VMCore/BasicBlock.cpp	Fri Aug  5 10:34:10 2005
@@ -189,7 +189,8 @@
     // Okay, now we know that we need to remove predecessor #pred_idx from all
     // PHI nodes.  Iterate over each PHI node fixing them up
     PHINode *PN;
-    for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ++II) {
+    for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) {
+      ++II;
       PN->removeIncomingValue(Pred, false);
       // If all incoming values to the Phi are the same, we can replace the Phi
       // with that value.






More information about the llvm-commits mailing list