Skip to content

[5.0] SR-10240: Dont try to write an empty Data() as it has a nil baseAddress. #2054

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
Apr 12, 2019

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Apr 1, 2019

5.0 version of #2053. This crashes in 5.0 as the region has baseAddress = nil

@spevans
Copy link
Contributor Author

spevans commented Apr 1, 2019

@swift-ci test

@spevans
Copy link
Contributor Author

spevans commented Apr 1, 2019

cc @millenomi @weissi

@@ -126,7 +126,9 @@ open class FileHandle : NSObject, NSSecureCoding {
guard _fd >= 0 else { return }
data.enumerateBytes() { (bytes, range, stop) in
Copy link
Contributor

Choose a reason for hiding this comment

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

Just mentioning, looks like the method enumerateBytes() is deprecated in Swift 5.0. I am unsure if this PR is an appropriate place to make the changes, if not, I will update that the code in separate PR.

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 was trying to keep the fix as minimal as possible, I may update to it in a separate PR.

@millenomi
Copy link
Contributor

@swift-ci please test

Copy link
Contributor

@weissi weissi left a comment

Choose a reason for hiding this comment

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

👍 thanks

@weissi weissi merged commit d447657 into swiftlang:swift-5.0-branch Apr 12, 2019
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