Skip to content

Conversation

@rvagg
Copy link
Contributor

@rvagg rvagg commented Mar 5, 2025

A bug in #109; many of the unmarshal components just reuse the primary maj, extra, err variables for cr.ReadHeader(), so that when you get to the end and want to use extra to length-check, it's already been overwritten with something else. This doesn't show up in the current tests because int64 happens to block scope and create new variables. But uint64 doesn't, so that's included in the test now and it fails without the fix. I remember hitting this when I was doing the generics work too.

This is the easy and less painful way of fixing it. Just capture the length and we're done.

#111 is the "hard way" (proper way).

We can debate and pick one.

@Stebalien
Copy link
Collaborator

This version leads to the least codegen churn and it's the safest.

@Stebalien Stebalien merged commit cba3eee into whyrusleeping:master Mar 5, 2025
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