================ @@ -2240,14 +2242,28 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( break; } case bitc::METADATA_LABEL: { - if (Record.size() != 5) + if (Record.size() < 5 || Record.size() > 7) return error("Invalid record"); IsDistinct = Record[0] & 1; + uint64_t Line = Record[4]; + uint64_t Column = Record.size() > 5 ? Record[5] : 0; + bool IsArtificial = Record[0] & 2; + std::optional<unsigned> CoroSuspendIdx; + if (Record.size() > 6) { + unsigned RawSuspendIdx = Record[6]; + if (RawSuspendIdx != std::numeric_limits<unsigned>::max()) { + if (RawSuspendIdx > (uint64_t)std::numeric_limits<unsigned>::max()) + return error("CoroSuspendIdx value is too large"); ---------------- pogo59 wrote:
Sorry, what is this doing? How is it possible for `unsigned RawSuspendIdx` to exceed `numeric_limits<unsigned>::max()`? Did you mean to make the temp variable `uint64_t`? https://github.com/llvm/llvm-project/pull/141937 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits