From 8250d7385a16e8d586f608b3040eb6738bbf8e55 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 6 Mar 2012 02:00:52 +0000 Subject: Avoid finalizeBundles infinite looping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152089 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstrBundle.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/CodeGen/MachineInstrBundle.cpp') 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; -- cgit v1.2.3