Watch out for empty BB.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 2 Feb 2007 18:49:02 +0000 (18:49 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 2 Feb 2007 18:49:02 +0000 (18:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33788 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index 35066faf554cac566464077913e7f9b80521eca8..89c32aa2931566d41440eabc61a24058d52560c3 100644 (file)
@@ -352,6 +352,7 @@ void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
     // In thumb mode, if this block is a constpool island, pessmisticly assume
     // it needs to be padded by two byte so it's aligned on 4 byte boundary.
     if (AFI->isThumbFunction() &&
+        MBB.size() &&
         MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY)
       MBBSize += 2;