diff --git a/internal/compiler/compiler.go b/internal/compiler/compiler.go index 4ff563c..e4c9209 100644 --- a/internal/compiler/compiler.go +++ b/internal/compiler/compiler.go @@ -324,8 +324,11 @@ func (b Bytecode) CConsts() *obj.Object { } func (b Bytecode) Consts() []obj.Object { - var ret = make([]obj.Object, b.NConsts()) + if b.NConsts() == 0 { + return []obj.Object{} + } + var ret = make([]obj.Object, b.NConsts()) cconsts := (*[1 << 28]obj.Object)(unsafe.Pointer(b.consts))[:b.NConsts():b.NConsts()] for i := 0; i < int(b.NConsts()); i++ { diff --git a/tau.go b/tau.go index 993f6c8..db9786b 100644 --- a/tau.go +++ b/tau.go @@ -15,7 +15,7 @@ import ( "github.com/NicoNex/tau/internal/vm" ) -const TauVersion = "v2.0.11" +const TauVersion = "v2.0.13" var ErrParseError = errors.New("error: parse error")