mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-14 00:14:19 +00:00
Check that iterator I is not the end iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3a9b71434c
commit
dc6d846df5
@ -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…
x
Reference in New Issue
Block a user