Skip to content

[llvm-cov] Use-after-move of CoverageData #93798

@nikic

Description

@nikic

There are two places that move CoverageData inside a loop:

View.addBranch(CurrentLine, std::move(ViewBranches),
SourceCoverageView::create(SourceName, File, ViewOpts,
std::move(CoverageInfo)));

View.addMCDCRecord(CurrentLine, std::move(ViewMCDCRecords),
SourceCoverageView::create(SourceName, File, ViewOpts,
std::move(CoverageInfo)));

This looks incorrect to me, but I'm also unsure on what the right fix for this would be, as SourceCoverageView::create() accepts CoverageData by rvalue reference.

cc @evodius96 @MaskRay

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions