]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/gob: fix bug in Register
authorRob Pike <r@golang.org>
Tue, 3 Jul 2012 17:05:27 +0000 (10:05 -0700)
committerRob Pike <r@golang.org>
Tue, 3 Jul 2012 17:05:27 +0000 (10:05 -0700)
The old code added a star but did not indirect the reflect.Type.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6348067

src/pkg/encoding/gob/type.go

index 0dd7a0a770ea137956683f9e69c4ced123d1f2d3..908cc9ce1c42d7b98c4a1e75e3ff8a18ef327dd9 100644 (file)
@@ -755,7 +755,7 @@ func Register(value interface{}) {
        if rt.Name() == "" {
                if pt := rt; pt.Kind() == reflect.Ptr {
                        star = "*"
-                       rt = pt
+                       rt = pt.Elem()
                }
        }
        if rt.Name() != "" {