[llvm-commits] [llvm] r166784 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp

Akira Hatanaka ahatanaka at mips.com
Fri Oct 26 10:11:42 PDT 2012


Author: ahatanak
Date: Fri Oct 26 12:11:42 2012
New Revision: 166784

URL: http://llvm.org/viewvc/llvm-project?rev=166784&view=rev
Log:
Make sure I is not the end iterator when isInsideBundle is called. 

Modified:
    llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp

Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=166784&r1=166783&r2=166784&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Fri Oct 26 12:11:42 2012
@@ -145,7 +145,8 @@
   instr_iterator I = instr_begin(), E = instr_end();
   while (I != E && I->isPHI())
     ++I;
-  assert(!I->isInsideBundle() && "First non-phi MI cannot be inside a bundle!");
+  assert((I == E || !I->isInsideBundle()) &&
+         "First non-phi MI cannot be inside a bundle!");
   return I;
 }
 
@@ -156,7 +157,7 @@
     ++I;
   // FIXME: This needs to change if we wish to bundle labels / dbg_values
   // inside the bundle.
-  assert(!I->isInsideBundle() &&
+  assert((I == E || !I->isInsideBundle()) &&
          "First non-phi / non-label instruction is inside a bundle!");
   return I;
 }





More information about the llvm-commits mailing list