From: Chris Lattner Date: Sun, 22 Feb 2004 19:37:31 +0000 (+0000) Subject: Another bug fix for empty MBB's X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=d0d1c8f830afbdbb708096be27d35101e13414a6;p=oota-llvm.git Another bug fix for empty MBB's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11716 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 23063461d70..38e00733602 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -653,7 +653,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { const TargetInstrInfo &TII = TM->getInstrInfo(); MI = MBB.end(); while (MI != MBB.begin() && TII.isTerminatorInstr((--MI)->getOpcode())); - ++MI; + if (MI != MBB.end()) ++MI; // Spill all physical registers holding virtual registers now. for (unsigned i = 0, e = RegInfo->getNumRegs(); i != e; ++i)