Return state error code

This commit is contained in:
Ian Gulliver
2021-11-18 15:34:10 -10:00
parent b8b13680ad
commit 6de2e87342

View File

@@ -39,7 +39,7 @@ func NewStateFromByteCode(byteCodes [][]byte) (*State, error) {
return NewState(functions) return NewState(functions)
} }
func (state *State) Execute() { func (state *State) Execute() error {
state.setHandlers() state.setHandlers()
state.call(0) state.call(0)
state.running = true state.running = true
@@ -47,6 +47,8 @@ func (state *State) Execute() {
for state.running { for state.running {
state.processInstruction() state.processInstruction()
} }
return state.err
} }
func (state *State) stackFrame() *stackFrame { func (state *State) stackFrame() *stackFrame {