[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)
Paul T Robinson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 10:43:32 PDT 2025
================
@@ -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
More information about the llvm-commits
mailing list