Skip to content

[4.1] {JSON,Plist}{En,De}coder defer container pops #13900

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

Conversation

itaiferber
Copy link
Contributor

@itaiferber itaiferber commented Jan 12, 2018

What's in this pull request?
Cherry-picks #13879 to swift-4.1-branch. Resolves #48633 (rdar://problem/34857336), resolves swiftlang/swift-corelibs-foundation#4051 (rdar://problem/36336754), which became more common failures after #13178.

Itai Ferber added 2 commits January 11, 2018 20:51
Resolve SR-6078 by restoring the JSON/PlistEncoder stack if an error
is thrown after a container was pushed during encode.
Resolve SR-6408 by restoring the JSON/PlistDecoder stack if an error
is thrown after a container was pushed during encode.
@itaiferber
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@itaiferber
Copy link
Contributor Author

@swift-ci Please test macOS

@itaiferber
Copy link
Contributor Author

@swift-ci Please nominate

Explanation: Prevents {JSON,PropertyList}{En,De}coder state corruption if errors are thrown in the middle of encoding/decoding custom values
Scope: With #13178 in for Swift 4.1, this represents a regression for code that used to work for collections and now fails (this is now a much more prominent failure than before)
Radar: rdar://problem/34857336, rdar://problem/36336754
Origination: Internal & third-party reports (SR-6078, SR-6408)
Risk: Low
Reviewed by: @phausler
Testing: Adds new unit tests to catch regressions to this behavior

@itaiferber
Copy link
Contributor Author

@swift-ci Please test Linux

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