You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go version 1.3.3 (happens at play.golang.org, too)
What steps reproduce the problem?
1. Create two structs A and B.
2. Let B contain an exported int I, and A an exported pointer to a pointer to B named P.
3. Create an instance of B, set I, create an instance of A and let X point to a pointer
to the instance of B.
4. Encode with Gob.
5. Decode with Gob.
=> The value of I is incorrect.
Example: http://play.golang.org/p/RZj-VdGNvL
What happened?
Gob does not properly decode pointers with two levels of indirection. It seems that the
decoder adds another level of indirection (one to many). Example where you can see this
: http://play.golang.org/p/JkOWiyrHpE
What should have happened instead?
Pointers should be decoded correctly.
Please provide any additional information below.
There were issues with pointers in the past like :
https://code.google.com/p/go/source/detail?r=97815e81c184
decIndirect in the decoder is called twice with indir = 2 in the decoding process for A.
The second or the first call should use 1. I did not look into it deep enough to provide
a fix / suggestion.
The text was updated successfully, but these errors were encountered:
by martin@remerge.io:
The text was updated successfully, but these errors were encountered: