mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Avoid using BCRecordLayout for decoding swiftdocs
BCRecordLayout currently assumes that the layout described in source always matches the layout in the bitstream being read. Since we want swiftdocs to be a forward-compatible format, avoid using it for deserialization. (In the future, we may want to augment BCRecordLayout to handle records with more fields than expected. For now, though, this is a sufficient change.)
This commit is contained in:
@@ -955,8 +955,9 @@ public:
|
||||
std::unique_ptr<ModuleFile::SerializedDeclCommentTable>
|
||||
ModuleFile::readDeclCommentTable(ArrayRef<uint64_t> fields,
|
||||
StringRef blobData) {
|
||||
uint32_t tableOffset;
|
||||
index_block::DeclListLayout::readRecord(fields, tableOffset);
|
||||
if (fields.empty() || blobData.empty())
|
||||
return nullptr;
|
||||
uint32_t tableOffset = static_cast<uint32_t>(fields.front());
|
||||
auto base = reinterpret_cast<const uint8_t *>(blobData.data());
|
||||
|
||||
return std::unique_ptr<SerializedDeclCommentTable>(
|
||||
|
||||
Reference in New Issue
Block a user