]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/gob: fix Debug to properly print uint
authorDanny Rosseau <daniel.rosseau@gmail.com>
Thu, 10 Aug 2017 19:08:23 +0000 (13:08 -0600)
committerRob Pike <r@golang.org>
Fri, 25 Aug 2017 10:22:07 +0000 (10:22 +0000)
Fix debugger printing of uint that mistakenly
invoked .int64() instead of .uint64()

Fixes #21392

Change-Id: I107a7e87e0efbb06303c1e627dee76c369f75d1e
Reviewed-on: https://go-review.googlesource.com/54750
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/encoding/gob/codec_test.go
src/encoding/gob/debug.go

index eb9f306bcf5fcbf64a35e051e5261e6aad57ab2b..8f7b6f3c62ed28837d8abacb2a2c6a3cbb23edfb 100644 (file)
@@ -1321,6 +1321,7 @@ func TestUnexportedFields(t *testing.T) {
 var singletons = []interface{}{
        true,
        7,
+       uint(10),
        3.2,
        "hello",
        [3]int{11, 22, 33},
index d69d36f5164d51f796b50c229341757fc0c62ab4..8f93742f49946a70e6422d8e256e20c17c8aa9b1 100644 (file)
@@ -594,7 +594,7 @@ func (deb *debugger) printBuiltin(indent tab, id typeId) {
                x := deb.int64()
                fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
        case tUint:
-               x := deb.int64()
+               x := deb.uint64()
                fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
        case tFloat:
                x := deb.uint64()