|
|
@@ -504,7 +504,7 @@ func (x *genRunner) selfer(encode bool) {
|
|
|
t0 := t
|
|
|
// always make decode use a pointer receiver,
|
|
|
// and structs always use a ptr receiver (encode|decode)
|
|
|
- isptr := !encode || t.Kind() == reflect.Struct
|
|
|
+ isptr := !encode || (t.Kind() == reflect.Struct || t.Kind() == reflect.Array)
|
|
|
x.varsfxreset()
|
|
|
fnSigPfx := "func (x "
|
|
|
if isptr {
|
|
|
@@ -999,7 +999,7 @@ func (x *genRunner) encListFallback(varname string, t reflect.Type) {
|
|
|
return
|
|
|
}
|
|
|
if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 {
|
|
|
- x.linef("r.EncodeStringBytes(codecSelferC_RAW%s, ([%v]byte(%s))[:])", x.xs, t.Len(), varname)
|
|
|
+ x.linef("r.EncodeStringBytes(codecSelferC_RAW%s, ((*[%d]byte)(%s))[:])", x.xs, t.Len(), varname)
|
|
|
return
|
|
|
}
|
|
|
i := x.varsfx()
|
|
|
@@ -1332,7 +1332,7 @@ func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type
|
|
|
return
|
|
|
}
|
|
|
if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 {
|
|
|
- x.linef("r.DecodeBytes( ((*[%s]byte)(%s))[:], true)", t.Len(), varname)
|
|
|
+ x.linef("r.DecodeBytes( ((*[%d]byte)(%s))[:], true)", t.Len(), varname)
|
|
|
return
|
|
|
}
|
|
|
type tstruc struct {
|