From 6de2e87342fa6886a64803fcecf04e17a77c7108 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 18 Nov 2021 15:34:10 -1000 Subject: [PATCH] Return state error code --- vm/state.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vm/state.go b/vm/state.go index 9bf4c57..f615751 100644 --- a/vm/state.go +++ b/vm/state.go @@ -39,7 +39,7 @@ func NewStateFromByteCode(byteCodes [][]byte) (*State, error) { return NewState(functions) } -func (state *State) Execute() { +func (state *State) Execute() error { state.setHandlers() state.call(0) state.running = true @@ -47,6 +47,8 @@ func (state *State) Execute() { for state.running { state.processInstruction() } + + return state.err } func (state *State) stackFrame() *stackFrame {