Skip to content

Commit 0184075

Browse files
authored
Merge pull request swiftlang#39884 from zoecarver/fix-big-lookup-tables
[cxx-interop] Bump data length to use uint32_t.
2 parents 3927e78 + f8abf50 commit 0184075

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/ClangImporter/SwiftLookupTable.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,11 @@ namespace {
12391239
// # of entries
12401240
uint32_t dataLength =
12411241
sizeof(uint16_t) + sizeof(uint64_t) * data.size();
1242-
assert(dataLength == static_cast<uint16_t>(dataLength));
1242+
assert(dataLength == static_cast<uint32_t>(dataLength));
12431243

12441244
endian::Writer writer(out, little);
12451245
writer.write<uint16_t>(keyLength);
1246-
writer.write<uint16_t>(dataLength);
1246+
writer.write<uint32_t>(dataLength);
12471247
return { keyLength, dataLength };
12481248
}
12491249

@@ -1513,7 +1513,7 @@ namespace {
15131513
static std::pair<unsigned, unsigned>
15141514
ReadKeyDataLength(const uint8_t *&data) {
15151515
unsigned keyLength = endian::readNext<uint16_t, little, unaligned>(data);
1516-
unsigned dataLength = endian::readNext<uint16_t, little, unaligned>(data);
1516+
unsigned dataLength = endian::readNext<uint32_t, little, unaligned>(data);
15171517
return { keyLength, dataLength };
15181518
}
15191519

lib/ClangImporter/SwiftLookupTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MAJOR = 1;
276276
/// Lookup table minor version number.
277277
///
278278
/// When the format changes IN ANY WAY, this number should be incremented.
279-
const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MINOR = 16; // Lazy Member Loading Index
279+
const uint16_t SWIFT_LOOKUP_TABLE_VERSION_MINOR = 17; // Lazy Member Loading Index
280280

281281
/// A lookup table that maps Swift names to the set of Clang
282282
/// declarations with that particular name.

0 commit comments

Comments
 (0)