diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 33859b91c..5cc6b872a 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -317,7 +317,9 @@ func (v *VM) loadScriptWithCallingHash(b []byte, exe *nef.File, caller util.Uint v.checkInvocationStackSize() ctx := NewContextWithParams(b, rvcount, offset) - v.estack = newStack("evaluation", &v.refs) + if rvcount != -1 || v.estack.Len() != 0 { + v.estack = newStack("evaluation", &v.refs) + } ctx.estack = v.estack initStack(&ctx.tryStack, "exception", nil) ctx.callFlag = f