Skip to content

[DefiniteInitialization] Check whether globals captured by top-level defer statements are initialized. #17542

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
Jul 2, 2018

Conversation

ravikandhadai
Copy link
Contributor

rdar://30720636

@ravikandhadai
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

LGTM.

@ravikandhadai
Copy link
Contributor Author

@swift-ci please smoke test

@ravikandhadai
Copy link
Contributor Author

Pushed a new commit that resolves merge conflicts

@@ -1243,10 +1244,13 @@ void LifetimeChecker::handleEscapeUse(const DIMemoryUse &Use) {

Diag<StringRef, bool> DiagMessage;
if (isa<MarkFunctionEscapeInst>(Inst)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add comments here explaining why this code is arranged this way and how that maps to code? The reason I am asking is that you have this paged into your head right now. We should document this behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am fine if you want to do that in a subsequent commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I have added some explanation to this piece of code. My exact change here is to just introduce a new else if condition to the logic in the "MarkFunctionEscapeInst" branch, which is something I understand well. The rest of the logic existed before. However, I have documented my overall understanding of the code here.

defer statements are initialized.

<rdar://30720636>
@ravikandhadai
Copy link
Contributor Author

@swift-ci please smoke 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.

Thats better than what we have here. I think the prose can be cleaned up, but I think you are leaving this better than you found it, so I am fine with it.

@ravikandhadai
Copy link
Contributor Author

@swift-ci please test and merge

1 similar comment
@ravikandhadai
Copy link
Contributor Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit 7bc1944 into swiftlang:master Jul 2, 2018
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