func (vm *VM) stop() (Addr, bool) {
	const maxAddr = 1<<32 - 1
	atomic.StoreInt32(&vm.env.done, 1)
	return maxAddr, false
}
stop is called in the vm.run method to stop the execution.
package runtime
import (
	"context"
	"errors"
	"io"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"sync/atomic"
	"github.com/open2b/scriggo/ast"
	"github.com/open2b/scriggo/native"
)
const NoVariadicArgs = -1
const CurrentFunction = -1
const ReturnString = -1
const maxUint32 = 1<<31 - 1
const stackSize = 512
var envType = reflect.TypeOf((*native.Env)(nil)).Elem()
var emptyInterfaceType = reflect.TypeOf(&[]interface{}{nil}[0]).Elem()
var emptyInterfaceNil = reflect.ValueOf(&[]interface{}{nil}[0]).Elem()
type Converter func(src []byte, out io.Writer) error
type TypeOfFunc func(reflect.Value) reflect.Type
type ScriggoType interface {
	reflect.Type
	Wrap(reflect.Value) reflect.Value
	Unwrap(reflect.Value) (reflect.Value, bool)
	GoType() reflect.Type
}
type StackShift [4]int8
type Instruction struct {
	Op      Operation
	A, B, C int8
}
func decodeInt16(a, b int8) int16 {
	return int16(int(a)<<8 | int(uint8(b)))
}
func decodeUint16(a, b int8) uint16 {
	return uint16(uint8(a))<<8 | uint16(uint8(b))
}
func decodeUint24(a, b, c int8) uint32 {
	return uint32(uint8(a))<<16 | uint32(uint8(b))<<8 | uint32(uint8(c))
}
func decodeValueIndex(a, b int8) (t registerType, i int) {
	return registerType(uint8(a) >> 6), int(decodeUint16(a, b) &^ (3 << 14))
}
type VM struct {
	fp       [4]Addr               
	st       [4]Addr               
	pc       Addr                  
	ok       bool                  
	regs     registers             
	fn       *Function             
	vars     []reflect.Value       
	env      *env                  
	envArg   reflect.Value         
	renderer *renderer             
	calls    []callFrame           
	cases    []reflect.SelectCase  
	panic    *PanicError           
	main     bool                  
}
func NewVM() *VM {
	vm := create(&env{})
	vm.main = true
	return vm
}
func (vm *VM) Reset() {
	vm.fp = [4]Addr{0, 0, 0, 0}
	vm.st[0] = Addr(len(vm.regs.int))
	vm.st[1] = Addr(len(vm.regs.float))
	vm.st[2] = Addr(len(vm.regs.string))
	vm.st[3] = Addr(len(vm.regs.general))
	vm.pc = 0
	vm.ok = false
	vm.fn = nil
	vm.vars = nil
	vm.env = &env{}
	vm.envArg = reflect.ValueOf(vm.env)
	vm.renderer = nil
	if vm.calls != nil {
		vm.calls = vm.calls[:0]
	}
	if vm.cases != nil {
		vm.cases = vm.cases[:0]
	}
	vm.panic = nil
}