fix off-by-one computing size for section abbrevs
authorChris Lattner <sabre@nondot.org>
Tue, 24 Apr 2007 03:29:47 +0000 (03:29 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Apr 2007 03:29:47 +0000 (03:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36388 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index b229a764ef9cf2baf1101032d16cf9e2bc59bb53..ea314f69ebfd73ee916f7fb91831c52147380c08 100644 (file)
@@ -220,7 +220,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
       Abbv->Add(BitCodeAbbrevOp(0));
     else
       Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth,
-                               Log2_32_Ceil(SectionMap.size())));
+                               Log2_32_Ceil(SectionMap.size()+1)));
     // Don't bother emitting vis + thread local.
     SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv);
   }