Skip to content

[Coverage] Fix UB in use of the CoverageMappingWriter API #6424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2016

Conversation

vedantk
Copy link
Contributor

@vedantk vedantk commented Dec 21, 2016

Passing {FileID} into the CoverageMappingWriter constructor causes UB.
The ArrayRef constructed from the initializer list becomes invalid once
the constructor returns, because the lifetime of the initializer list
expires. Use an alternate ArrayRef constructor which outlives the
CoverageMappingWriter instance.

This commit also re-reenables coverage_smoke.swift.

rdar://problem/29591622

Passing {FileID} into the CoverageMappingWriter constructor causes UB.
The ArrayRef constructed from the initializer list becomes invalid once
the constructor returns, because the lifetime of the initializer list
expires. Use an alternate ArrayRef constructor which outlives the
CoverageMappingWriter instance.

This commit also re-reenables coverage_smoke.swift.

rdar://problem/29591622
@vedantk
Copy link
Contributor Author

vedantk commented Dec 21, 2016

@swift-ci Please smoke test

@vedantk vedantk merged commit 9dceb9f into swiftlang:master Dec 21, 2016
@vedantk vedantk deleted the re-reenable-coverage-smoke branch January 31, 2018 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant