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.
This commit is contained in:
Roman Khimov 2022-11-18 10:51:29 +03:00
parent cb64957af5
commit 8e7f65be17

View file

@ -1754,6 +1754,7 @@ func (v *VM) handleException() {
v.istack = v.istack[:len(v.istack)-1] v.istack = v.istack[:len(v.istack)-1]
v.unloadContext(ctx) v.unloadContext(ctx)
} }
v.estack = ictx.sc.estack
if ectx.State == eTry && ectx.HasCatch() { if ectx.State == eTry && ectx.HasCatch() {
ectx.State = eCatch ectx.State = eCatch
v.estack.PushItem(v.uncaughtException) v.estack.PushItem(v.uncaughtException)