Skip to content

Use cbor-gen for everything except Pointers #124

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 2 commits into from
Aug 5, 2024

Conversation

Stebalien
Copy link
Member

We're stuck with a custom decoder for pointers, but we can at least use cbor-gen for everything else.

Without touching the generated code. This is a slightly breaking change,
but it shouldn't affect anyone.
We'd previously reject the pointers in UnmarshalCBOR, but cbor-gen has
moved on and will now decode null. The KVs are manually decoded and
should never be nil, even now, but... I'm adding the check just to be
extra safe.
@@ -385,6 +383,11 @@ func loadNode(
}

for _, ch := range out.Pointers {
if ch == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

I looked into removing the pointers and broke everything, so now I guess we're just living with this.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, that's a bit odd, I guess we're mutating in place and not saving it or something

@rvagg rvagg merged commit 53db272 into rvagg/update Aug 5, 2024
7 checks passed
@rvagg rvagg deleted the steb/fix-bitfield-serialize branch August 5, 2024 02:39
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