Make divide-by-zero error, handle error gracefully in grow

This commit is contained in:
Ian Gulliver
2021-11-22 20:46:20 -08:00
parent a5e44a7e07
commit c547abb296
3 changed files with 10 additions and 12 deletions

View File

@@ -75,8 +75,7 @@ func (state *State) processInstruction() {
state.instructionCount += 1
if state.program.InstructionLimit > 0 && state.instructionCount > state.program.InstructionLimit {
state.err = fmt.Errorf("Instruction limit (%d) exceeded", state.program.InstructionLimit)
state.running = false
state.setError(fmt.Errorf("Instruction limit (%d) exceeded", state.program.InstructionLimit))
}
for state.functionIndex < 0 ||