-
Notifications
You must be signed in to change notification settings - Fork 50
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
node/bindnode: using Unwrap on some bindnode nodes can panic #339
Comments
mvdan
changed the title
node/bindnode: using Wrap on some nodes can panic
node/bindnode: using Unwrap on some bindnode nodes can panic
Feb 11, 2022
rvagg
added a commit
that referenced
this issue
May 24, 2022
Closes: #339 I can't repro the error in 339, so I'm adding this test and will close the issue
rvagg
added a commit
that referenced
this issue
May 24, 2022
Closes: #339 I can't repro the error in 339, so I'm adding this test and will close the issue. Perhaps someone else can add something to this test that will trigger the problem.
I've tried pretty hard to reproduce this but can't. Various types of both addressable and unaddressable values and unwrapping sub-nodes within a larger data structure, but can't. So I'm going to close this issue after adding #431 which has my attempts at getting to this error. If someone else manages to come up with a case that causes this problem then we can fix it then. |
rvagg
added a commit
that referenced
this issue
May 25, 2022
Closes: #339 I can't repro the error in 339, so I'm adding this test and will close the issue. Perhaps someone else can add something to this test that will trigger the problem.
rvagg
added a commit
that referenced
this issue
May 25, 2022
Closes: #339 I can't repro the error in 339, so I'm adding this test and will close the issue. Perhaps someone else can add something to this test that will trigger the problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example, I just tried using it on the nodes returned by
MapIterator.Next
, and I get:This is most likely because the
MapIterator
code path doesn't createdatamodel.Node
values with addressable Go values underneath.I see three possible fixes:
I don't like option 3, because at best we duplicate API, and at worst we'd break users. It's also harder to have to explain that some nodes aren't like others.
Option 2 would be the easiest, but also slightly inconsistent. If unwrapping one node twice returns two copies, but unwrapping another node doesn't make copies and returns the same pointer twice, then suddenly those two scenarios are very different.
So, option 1 seems best.
The text was updated successfully, but these errors were encountered: