about summary refs log tree commit diff
path: root/pkg/lang/vm/vm.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-18 02:19:35 +0200
committerMel <einebeere@gmail.com>2022-05-18 02:19:35 +0200
commit0a7927ed8257857c8d114387f12844312f6da51c (patch)
tree5fa9829606be6dc1c0f0d4b092a4bc29a96e24a0 /pkg/lang/vm/vm.go
parent3abe18ffca484efc3553aa4ec9cb677eb19cdaf4 (diff)
downloadjinx-0a7927ed8257857c8d114387f12844312f6da51c.tar.zst
jinx-0a7927ed8257857c8d114387f12844312f6da51c.zip
Start call stack with at least one frame
Diffstat (limited to 'pkg/lang/vm/vm.go')
-rw-r--r--pkg/lang/vm/vm.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/lang/vm/vm.go b/pkg/lang/vm/vm.go
index 434eae3..a6e1fb8 100644
--- a/pkg/lang/vm/vm.go
+++ b/pkg/lang/vm/vm.go
@@ -13,8 +13,9 @@ type VM struct {
 
 func New(code *code.Code) *VM {
 	return &VM{
-		code: code,
-		pc:   0,
+		code:  code,
+		pc:    0,
+		stack: NewCallStack(),
 	}
 }