summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstrBundle.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-03-06 02:00:52 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-03-06 02:00:52 +0000
commit8250d7385a16e8d586f608b3040eb6738bbf8e55 (patch)
tree7cb5904d88a6b745f65ce273a66296155177a435 /lib/CodeGen/MachineInstrBundle.cpp
parentafd3d56b9dc791d37120922318293a021bd35598 (diff)
downloadllvm-8250d7385a16e8d586f608b3040eb6738bbf8e55.tar.gz
llvm-8250d7385a16e8d586f608b3040eb6738bbf8e55.tar.bz2
llvm-8250d7385a16e8d586f608b3040eb6738bbf8e55.tar.xz
Avoid finalizeBundles infinite looping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r--lib/CodeGen/MachineInstrBundle.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstrBundle.cpp b/lib/CodeGen/MachineInstrBundle.cpp
index d1f2df94b5..73489a7160 100644
--- a/lib/CodeGen/MachineInstrBundle.cpp
+++ b/lib/CodeGen/MachineInstrBundle.cpp
@@ -229,6 +229,8 @@ bool llvm::finalizeBundles(MachineFunction &MF) {
"First instr cannot be inside bundle before finalization!");
MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
+ if (MII == MIE)
+ continue;
for (++MII; MII != MIE; ) {
if (!MII->isInsideBundle())
++MII;