Skip to content

SILCombine: fix wrong placement of a strong_release of a dead closure argument which caused a memory leak #21391

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 18, 2018

Conversation

eeckstein
Copy link
Contributor

The code to find the release-points didn't handle release_value instructions.

https://bugs.swift.org/browse/SR-9518
rdar://problem/46794455

… argument which caused a memory leak

The code to find the release-points didn't handle release_value instructions.

https://bugs.swift.org/browse/SR-9518
rdar://problem/46794455
@eeckstein eeckstein requested a review from gottesmm December 18, 2018 00:23
@eeckstein
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I wonder if it would make sense to make this optimization more conservative by bailing if we find something that /may/ release but that we do not recognize. Then at least we wouldn't have optimized this case.

@atrick
Copy link
Contributor

atrick commented Dec 18, 2018

As a rule, I would say that opcode lists should never appear in /SILOptimizer unless they are part of a bailout or guarded by that bailout with assertions. There should be one place in /SIL that associates opcodes with a SIL property.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0983e84

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test linux

1 similar comment
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test linux

@eeckstein eeckstein merged commit 9b95557 into swiftlang:master Dec 18, 2018
@eeckstein eeckstein deleted the fix-dead-closure-elimination branch December 18, 2018 17:20
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.

4 participants