Files
llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp
Tomohiro Kashiwada ca09801bd0 [LLVM][Coverage][Unittest] Fix dangling reference in unittest (#147118)
In loop of `writeAndReadCoverageRegions`, `OutputFunctions[I].Filenames`
references to contents of `Filenames` after returning from
`readCoverageRegions` but `Filenames` will be cleared in next call of
`readCoverageRegions`, causes dangling reference.
The lifetime of the contents of `Filenames` must be equal or longer than
`OutputFunctions[I]`, thus it has been moved into `OutputFunctions[I]`
(typed `OutputFunctionCoverageData`).
2025-09-11 23:12:54 +03:00

45 KiB