Skip to content
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

Update for SE-0055: Making pointer nullability explicit #232

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

jrose-apple
Copy link
Contributor

See swiftlang/swift#1878. Note: this needs a coordinated merge, i.e. it must go in ASAP after that request!

@jrose-apple
Copy link
Contributor Author

@mxcl or someone else, would you mind reviewing?

try body(fp)
fclose(fp) // defer is not necessarily immediate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

defer will always happen at the end of the scope (close-brace), just like a C++ destructor. It can get moved around by optimization, but so can everything else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Without this I was having the file write not be flushed sometimes before we tried to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I really don't think that should happen…or rather, I can't think of any way that would happen that wouldn't do the same thing with the manual invocation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can believe there's a bug, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

K, well let's remove it then and if we see the behavior I described we will investigate further.

@mxcl
Copy link
Contributor

mxcl commented Apr 1, 2016

LGTM though we may want to avoid the removal of that defer.

@jrose-apple jrose-apple merged commit e8cd7d7 into swiftlang:master Apr 12, 2016
@jrose-apple jrose-apple deleted the optional-pointers branch April 13, 2016 02:14
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.

2 participants