[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:
Yuta Saito
2020-08-06 00:47:43 +09:00
parent d3f0de804d
commit d913e57d84
3 changed files with 58 additions and 5 deletions

View File

@@ -856,6 +856,8 @@ void Serializer::writeBlockInfoBlock() {
BLOCK_RECORD(sil_index_block, SIL_DEFAULT_WITNESS_TABLE_NAMES);
BLOCK_RECORD(sil_index_block, SIL_DEFAULT_WITNESS_TABLE_OFFSETS);
BLOCK_RECORD(sil_index_block, SIL_PROPERTY_OFFSETS);
BLOCK_RECORD(sil_index_block, SIL_DIFFERENTIABILITY_WITNESS_NAMES);
BLOCK_RECORD(sil_index_block, SIL_DIFFERENTIABILITY_WITNESS_OFFSETS);
#undef BLOCK
#undef BLOCK_RECORD