vm: break circular references when recursing into ToContractParameters
Reference types can have circular pointers to each other, thus we need to control recursion.
This commit is contained in:
parent
3282c6ed41
commit
9b4fd99fbc
4 changed files with 37 additions and 23 deletions
|
@ -60,7 +60,8 @@ var toContractParameterTestCases = []struct {
|
|||
|
||||
func TestToContractParameter(t *testing.T) {
|
||||
for _, tc := range toContractParameterTestCases {
|
||||
res := tc.input.ToContractParameter()
|
||||
seen := make(map[StackItem]bool)
|
||||
res := tc.input.ToContractParameter(seen)
|
||||
assert.Equal(t, res, tc.result)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue