Return state error code
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user