Fix crash on call as last instruction in function
This commit is contained in:
@@ -79,11 +79,11 @@ func (state *State) processInstruction() {
|
|||||||
state.running = false
|
state.running = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if state.functionIndex < 0 || state.functionIndex >= int64(len(state.program.Functions)) {
|
for state.functionIndex < 0 ||
|
||||||
state.ret()
|
state.functionIndex >= int64(len(state.program.Functions)) ||
|
||||||
}
|
state.instructionIndex < 0 ||
|
||||||
|
state.instructionIndex >= int64(len(state.function().Instructions)) {
|
||||||
|
|
||||||
if state.instructionIndex < 0 || state.instructionIndex >= int64(len(fnc.Instructions)) {
|
|
||||||
state.ret()
|
state.ret()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user