forked from TrueCloudLab/neoneo-go
Merge pull request #2491 from nspcc-dev/fix-2489
core: pop native call arguments after call invocation
This commit is contained in:
commit
4b785d4ffb
1 changed files with 4 additions and 1 deletions
|
@ -50,9 +50,12 @@ func Call(ic *interop.Context) error {
|
||||||
ctx := ic.VM.Context()
|
ctx := ic.VM.Context()
|
||||||
args := make([]stackitem.Item, len(m.MD.Parameters))
|
args := make([]stackitem.Item, len(m.MD.Parameters))
|
||||||
for i := range args {
|
for i := range args {
|
||||||
args[i] = ic.VM.Estack().Pop().Item()
|
args[i] = ic.VM.Estack().Peek(i).Item()
|
||||||
}
|
}
|
||||||
result := m.Func(ic, args)
|
result := m.Func(ic, args)
|
||||||
|
for range m.MD.Parameters {
|
||||||
|
ic.VM.Estack().Pop()
|
||||||
|
}
|
||||||
if m.MD.ReturnType != smartcontract.VoidType {
|
if m.MD.ReturnType != smartcontract.VoidType {
|
||||||
ctx.Estack().PushItem(result)
|
ctx.Estack().PushItem(result)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue