These numbers are intended to be capped at 65535, but
`std::max<uint16_t>(UINT16_MAX, N)` always returns N for any N because
the expression is the same as `std::max((uint16_t)UINT16_MAX, (uint16_t)N)`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287060
91177308-0d34-0410-b5e6-
96231b3b80d8
WritableStreamRef(FileInfoBuffer).keep_front(NamesOffset);
StreamWriter MetadataWriter(MetadataBuffer);
- uint16_t ModiCount = std::min<uint16_t>(UINT16_MAX, ModuleInfos.size());
- uint16_t FileCount = std::min<uint16_t>(UINT16_MAX, SourceFileNames.size());
+ uint16_t ModiCount = std::min<uint32_t>(UINT16_MAX, ModuleInfos.size());
+ uint16_t FileCount = std::min<uint32_t>(UINT16_MAX, SourceFileNames.size());
if (auto EC = MetadataWriter.writeInteger(ModiCount)) // NumModules
return EC;
if (auto EC = MetadataWriter.writeInteger(FileCount)) // NumSourceFiles