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

Fix decoding union into a previously used object #14

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

bartekn
Copy link

@bartekn bartekn commented Oct 23, 2020

This commit fixes a bug in Decoder.decodeUnion. When decoding a union previously used object (ex. in a loop with object created outside of the loop) the previous arm value was not zeroed (set to nil) if it was a different union type. See TestDecodeUnionIntoExistingObject for more context.

@bartekn bartekn requested review from leighmcculloch and a team October 23, 2020 15:37
@bartekn bartekn merged commit f0e124a into master Oct 28, 2020
@bartekn bartekn deleted the fix-union-decode-reuse branch October 28, 2020 10:23
bartekn added a commit to stellar/go that referenced this pull request Oct 28, 2020
Upgrade `go-xdr` to the latest version. The new version fixes two bugs
in `Decoder`: stellar/go-xdr#13 stellar/go-xdr#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