forked from OSchip/llvm-project
Check that iterator I is not the end iterator.
llvm-svn: 167086
This commit is contained in:
parent
c14b96898a
commit
ebb31e9c42
|
@ -1015,9 +1015,10 @@ MachineInstr::getRegClassConstraint(unsigned OpIdx,
|
|||
unsigned MachineInstr::getBundleSize() const {
|
||||
assert(isBundle() && "Expecting a bundle");
|
||||
|
||||
MachineBasicBlock::const_instr_iterator I = *this;
|
||||
const MachineBasicBlock *MBB = getParent();
|
||||
MachineBasicBlock::const_instr_iterator I = *this, E = MBB->instr_end();
|
||||
unsigned Size = 0;
|
||||
while ((++I)->isInsideBundle()) {
|
||||
while ((++I != E) && I->isInsideBundle()) {
|
||||
++Size;
|
||||
}
|
||||
assert(Size > 1 && "Malformed bundle");
|
||||
|
|
Loading…
Reference in New Issue