mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 15:07:36 +00:00
stackitem: properly detect recursive references during serialization
If we're done with element it no longer can lead to recursion error, so fix cases like `[arr, arr]` where we have two copies of `arr` trigger this error for no good reason (there is no recursion there).
This commit is contained in:
parent
ae8f4ebd5e
commit
6879cbcdcc
2 changed files with 4 additions and 0 deletions
|
@ -241,6 +241,7 @@ func toJSONWithTypes(item Item, seen map[Item]bool) (interface{}, error) {
|
|||
arr = append(arr, s)
|
||||
}
|
||||
value = arr
|
||||
delete(seen, item)
|
||||
case *Bool:
|
||||
value = it.value
|
||||
case *Buffer, *ByteArray:
|
||||
|
@ -266,6 +267,7 @@ func toJSONWithTypes(item Item, seen map[Item]bool) (interface{}, error) {
|
|||
})
|
||||
}
|
||||
value = arr
|
||||
delete(seen, item)
|
||||
case *Pointer:
|
||||
value = it.pos
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue