From 8e7f65be170aedf400f97363078a54d7e642437f Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 18 Nov 2022 10:51:29 +0300 Subject: [PATCH] vm: use proper estack for exception handler v.estack might be some inner invoked contract and its stack must not be used for exception handler set up by higher-order contract. --- pkg/vm/vm.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 92f9db474..ef8c41351 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -1754,6 +1754,7 @@ func (v *VM) handleException() { v.istack = v.istack[:len(v.istack)-1] v.unloadContext(ctx) } + v.estack = ictx.sc.estack if ectx.State == eTry && ectx.HasCatch() { ectx.State = eCatch v.estack.PushItem(v.uncaughtException)