[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

Evan Cheng evan.cheng at apple.com
Mon Jun 4 13:34:55 PDT 2007



Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.22 -> 1.23
---
Log message:

Forgot to check for if iterator reached the end.

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

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


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.22 llvm/lib/CodeGen/IfConversion.cpp:1.23
--- llvm/lib/CodeGen/IfConversion.cpp:1.22	Mon Jun  4 01:47:22 2007
+++ llvm/lib/CodeGen/IfConversion.cpp	Mon Jun  4 15:33:36 2007
@@ -441,8 +441,9 @@
 /// isNextBlock - Returns true either if ToBB the next block after BB or
 /// that all the intervening blocks are empty.
 static bool isNextBlock(MachineBasicBlock *BB, MachineBasicBlock *ToBB) {
+  MachineFunction *MF = BB->getParent();
   MachineFunction::iterator I = BB;
-  while (++I != MachineFunction::iterator(ToBB))
+  while (++I != MF->end() && I != MachineFunction::iterator(ToBB))
     if (!I->empty())
       return false;
   return true;






More information about the llvm-commits mailing list