mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
accounts/abi: Must copy arrays of arrays element wise
This commit is contained in:
parent
f3228592f5
commit
ac7a2658c4
1 changed files with 8 additions and 1 deletions
|
|
@ -81,7 +81,14 @@ func set(dst, src reflect.Value, output Argument) error {
|
|||
if dst.Len() < output.Type.SliceSize {
|
||||
return fmt.Errorf("abi: cannot unmarshal src (len=%d) in to dst (len=%d)", output.Type.SliceSize, dst.Len())
|
||||
}
|
||||
reflect.Copy(dst, src)
|
||||
switch dstType.Elem().Kind() {
|
||||
case reflect.Array:
|
||||
for i := 0; i < dst.Len(); i++ {
|
||||
reflect.Copy(dst.Index(i), src.Index(i))
|
||||
}
|
||||
default:
|
||||
reflect.Copy(dst, src)
|
||||
}
|
||||
case dstType.Kind() == reflect.Interface:
|
||||
dst.Set(src)
|
||||
case dstType.Kind() == reflect.Ptr:
|
||||
|
|
|
|||
Loading…
Reference in a new issue