summaryrefslogtreecommitdiff
path: root/vm/vm.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2024-03-14 14:37:32 +0100
committerMarc Vertes <mvertes@free.fr>2024-03-14 14:37:32 +0100
commit378683d25bdae89fa446b2b82f8dda5d6b34ea33 (patch)
treecbf624e4eb38fafe51a12a718b48f43192cfcfac /vm/vm.go
parent60170bad25f912e0ba44e4c0095b54f6e26e307e (diff)
feat: initial support of closures
Also detection and automatic execution of main function. Make sure that all debug is output to stderr.
Diffstat (limited to 'vm/vm.go')
-rw-r--r--vm/vm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm/vm.go b/vm/vm.go
index a8c1f28..6472dae 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -145,7 +145,7 @@ func (m *Machine) Run() (err error) {
case Calli:
mem = append(mem, ValueOf(ip+1), ValueOf(fp))
fp = sp + 2
- ip += int(op[2])
+ ip = int(op[2])
continue
case CallX: // Should be made optional.
l := int(op[2])