summaryrefslogtreecommitdiff
path: root/libgo/go/encoding/gob
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/encoding/gob')
-rw-r--r--libgo/go/encoding/gob/debug.go3
-rw-r--r--libgo/go/encoding/gob/decoder.go4
-rw-r--r--libgo/go/encoding/gob/gobencdec_test.go1
3 files changed, 6 insertions, 2 deletions
diff --git a/libgo/go/encoding/gob/debug.go b/libgo/go/encoding/gob/debug.go
index 4a61d0fb2f8..6dc7fc9aca0 100644
--- a/libgo/go/encoding/gob/debug.go
+++ b/libgo/go/encoding/gob/debug.go
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Delete the next line to include this file in the gob package.
+// +build ignore
+
package gob
// This file is not normally included in the gob package. Used only for debugging the package itself.
diff --git a/libgo/go/encoding/gob/decoder.go b/libgo/go/encoding/gob/decoder.go
index 5e684d3ee7e..fb28c8caf53 100644
--- a/libgo/go/encoding/gob/decoder.go
+++ b/libgo/go/encoding/gob/decoder.go
@@ -75,7 +75,9 @@ func (dec *Decoder) recvMessage() bool {
dec.err = err
return false
}
- if nbytes >= 1<<31 {
+ // Upper limit of 1GB, allowing room to grow a little without overflow.
+ // TODO: We might want more control over this limit.
+ if nbytes >= 1<<30 {
dec.err = errBadCount
return false
}
diff --git a/libgo/go/encoding/gob/gobencdec_test.go b/libgo/go/encoding/gob/gobencdec_test.go
index b8dfeeb5156..83644c0331b 100644
--- a/libgo/go/encoding/gob/gobencdec_test.go
+++ b/libgo/go/encoding/gob/gobencdec_test.go
@@ -547,7 +547,6 @@ func (a isZeroBugArray) GobEncode() (b []byte, e error) {
}
func (a *isZeroBugArray) GobDecode(data []byte) error {
- println("DECODE")
if len(data) != len(a) {
return io.EOF
}