summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index bba29172a28..6eef594eaf1 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1844,7 +1844,7 @@ std::error_code BitcodeReader::ParseMetadata() {
break;
}
case bitc::METADATA_COMPILE_UNIT: {
- if (Record.size() != 14)
+ if (Record.size() < 14 || Record.size() > 15)
return Error("Invalid record");
MDValueList.AssignValue(
@@ -1855,7 +1855,8 @@ std::error_code BitcodeReader::ParseMetadata() {
getMDString(Record[7]), Record[8],
getMDOrNull(Record[9]), getMDOrNull(Record[10]),
getMDOrNull(Record[11]), getMDOrNull(Record[12]),
- getMDOrNull(Record[13]))),
+ getMDOrNull(Record[13]),
+ Record.size() == 14 ? 0 : Record[14])),
NextMDValueNo++);
break;
}
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 199663d1bfd..3a539e12926 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -949,6 +949,7 @@ static void WriteDICompileUnit(const DICompileUnit *N,
Record.push_back(VE.getMetadataOrNullID(N->getSubprograms().get()));
Record.push_back(VE.getMetadataOrNullID(N->getGlobalVariables().get()));
Record.push_back(VE.getMetadataOrNullID(N->getImportedEntities().get()));
+ Record.push_back(N->getDWOId());
Stream.EmitRecord(bitc::METADATA_COMPILE_UNIT, Record, Abbrev);
Record.clear();
OpenPOWER on IntegriCloud