summaryrefslogtreecommitdiff
path: root/src/pkg/gob/decoder.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/gob/decoder.go')
-rw-r--r--src/pkg/gob/decoder.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/gob/decoder.go b/src/pkg/gob/decoder.go
index 90dc2e34c..caec51712 100644
--- a/src/pkg/gob/decoder.go
+++ b/src/pkg/gob/decoder.go
@@ -108,8 +108,9 @@ func (dec *Decoder) Decode(e interface{}) os.Error {
}
// No, it's a value.
- // Make sure the type has been defined already.
- if dec.wireType[id] == nil {
+ // Make sure the type has been defined already or is a builtin type (for
+ // top-level singleton values).
+ if dec.wireType[id] == nil && builtinIdToType[id] == nil {
dec.state.err = errBadType
break
}