summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-10-26 17:11:42 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-10-26 17:11:42 +0000
commit6fe7acab9d38654f19e0a404e60c3a4a985f0c30 (patch)
tree4cbf61b4667b47d9758086a65e6de63efa40cefb /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentceb32bf28549cd209b92f36e8e7a749ad82e719c (diff)
downloadbcm5719-llvm-6fe7acab9d38654f19e0a404e60c3a4a985f0c30.tar.gz
bcm5719-llvm-6fe7acab9d38654f19e0a404e60c3a4a985f0c30.zip
Make sure I is not the end iterator when isInsideBundle is called.
llvm-svn: 166784
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 6ade6a85e53..18d021d521d 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -145,7 +145,8 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI() {
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 @@ MachineBasicBlock::SkipPHIsAndLabels(MachineBasicBlock::iterator I) {
++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;
}
OpenPOWER on IntegriCloud