Start exercising grow code, breaking the VM
This commit is contained in:
@@ -71,11 +71,11 @@ func (state *State) processInstruction() {
|
||||
state.instructionIndex += 1
|
||||
instr.opHandler(state, instr)
|
||||
|
||||
if state.functionIndex >= int64(len(state.program.Functions)) {
|
||||
if state.functionIndex < 0 || state.functionIndex >= int64(len(state.program.Functions)) {
|
||||
state.ret()
|
||||
}
|
||||
|
||||
if state.instructionIndex >= int64(len(fnc.Instructions)) {
|
||||
if state.instructionIndex < 0 || state.instructionIndex >= int64(len(fnc.Instructions)) {
|
||||
state.ret()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user