gob: add test for indirect maps, slices, arrays.

fix a bug in the handling of indirect maps.

R=rsc
CC=golang-dev
https://golang.org/cl/1132042
This commit is contained in:
Rob Pike 2010-05-06 10:45:18 -07:00
parent 6dbba67214
commit 9088f9f245
2 changed files with 67 additions and 3 deletions

View file

@ -599,9 +599,6 @@ func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string) (decOp
ovfl := overflow(name)
op = func(i *decInstr, state *decodeState, p unsafe.Pointer) {
up := unsafe.Pointer(p)
if indir > 1 {
up = decIndirect(up, indir)
}
state.err = decodeMap(t, state, uintptr(up), keyOp, elemOp, i.indir, keyIndir, elemIndir, ovfl)
}