<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/93798>93798</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-cov] Use-after-move of CoverageData
</td>
</tr>
<tr>
<th>Labels</th>
<td>
coverage,
tools:llvm-cov
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nikic
</td>
</tr>
</table>
<pre>
There are two places that move CoverageData inside a loop:
https://github.com/llvm/llvm-project/blob/43100766f287185642a3ccbf1a629915f85575e2/llvm/tools/llvm-cov/CodeCoverage.cpp#L351-L353
https://github.com/llvm/llvm-project/blob/43100766f287185642a3ccbf1a629915f85575e2/llvm/tools/llvm-cov/CodeCoverage.cpp#L377-L379
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
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMU8uO2zgQ_Brq0rBBNfUwDzp4bRhYYPaymeTOR8tihhYFkpIzfx9IzjxyzC0XCU2ii1VdXSoldx2JOlb_w-pzoeY8hNiN7sWZQgf72j0PFAlUJMj3AJNXhhLkQWW4hYXgFBaK6kpnlRW4MTlLoMCHMDFxZPzM-HHIeUprhReGl6vLw6z3JtwYXrxf3n67KYbvZDLDi_ZBM7xUouS8bZoeD215qJsKlTBG96VqUMqy7g913daEHzg5BJ_e8ExYGF5OwdIbx72ZJobiSdTl7knU4m-l17a7J9HKB73H93lwaZ3qSwI3mhAjmQw5wI0YnkDPGf5l2N5A-RRgHtMcCcII99WnPBBEdx0y9O4H9CFCXtHuYfYW9AagErCGfwlzNO90vjm6r2MRRxNJZWJ4YChZw0EZQ1PeWj7bv17pV4iL8jNBpJ4ijYb2n3UYA6zitATr5iSbtfhPpZf_1SsUthNWCqkK6sq2bHkjJDbF0PGqsjUit8aikZURjTXUVrzsZaOtagvXIceK14KXvETe7Enzg7VCS1mWUli-PnlTzu_Xye9DvBYupZk6KVp5KLzS5NOWAETzSxBDZHhiiA_TxPHDNFyDErvtQM_XxCruXcrpAz277LdIvTfVZ_iaaKf6THG3BSf0v2WnmKPv_ngVNxnrSj2ULB3-DAAA__--LDPP">