Index: lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitcodeWriter.cpp +++ lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2507,9 +2507,9 @@ // For the module-level VST, add abbrev Ids for the VST_CODE_FNENTRY // records, which are not used in the per-function VSTs. - unsigned FnEntry8BitAbbrev; - unsigned FnEntry7BitAbbrev; - unsigned FnEntry6BitAbbrev; + unsigned FnEntry8BitAbbrev = 0; + unsigned FnEntry7BitAbbrev = 0; + unsigned FnEntry6BitAbbrev = 0; if (IsModuleLevel && hasVSTOffsetPlaceholder()) { // 8-bit fixed-width VST_CODE_FNENTRY function strings. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); @@ -2582,11 +2582,15 @@ NameVals.push_back(BitcodeIndex / 32); Code = bitc::VST_CODE_FNENTRY; + assert(FnEntry8BitAbbrev && "abbrev was not computed"); AbbrevToUse = FnEntry8BitAbbrev; - if (Bits == SE_Char6) + if (Bits == SE_Char6) { + assert(FnEntry6BitAbbrev && "abbrev was not computed"); AbbrevToUse = FnEntry6BitAbbrev; - else if (Bits == SE_Fixed7) + } else if (Bits == SE_Fixed7) { + assert(FnEntry7BitAbbrev && "abbrev was not computed"); AbbrevToUse = FnEntry7BitAbbrev; + } } else { Code = bitc::VST_CODE_ENTRY; if (Bits == SE_Char6)