mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Serialize Differentiability WT index sorted
When there are sil_property and sil_differentiability_witness at once, serialized file couldn't be deserialized because it's index table is serialized un-sortedly but deserializer assumes that contents of table index are sorted. This patch fixes the un-sorted serialization and adds test case to ensure that table index contents can be deserialized
This commit is contained in:
@@ -2346,6 +2346,11 @@ void SILSerializer::writeIndexTables() {
|
||||
DefaultWitnessTableOffset);
|
||||
}
|
||||
|
||||
if (!PropertyOffset.empty()) {
|
||||
Offset.emit(ScratchRecord, sil_index_block::SIL_PROPERTY_OFFSETS,
|
||||
PropertyOffset);
|
||||
}
|
||||
|
||||
if (!DifferentiabilityWitnessList.empty()) {
|
||||
writeIndexTable(S, List,
|
||||
sil_index_block::SIL_DIFFERENTIABILITY_WITNESS_NAMES,
|
||||
@@ -2355,11 +2360,6 @@ void SILSerializer::writeIndexTables() {
|
||||
DifferentiabilityWitnessOffset);
|
||||
}
|
||||
|
||||
if (!PropertyOffset.empty()) {
|
||||
Offset.emit(ScratchRecord, sil_index_block::SIL_PROPERTY_OFFSETS,
|
||||
PropertyOffset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SILSerializer::writeSILGlobalVar(const SILGlobalVariable &g) {
|
||||
|
||||
Reference in New Issue
Block a user