From 378683d25bdae89fa446b2b82f8dda5d6b34ea33 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 14 Mar 2024 14:37:32 +0100 Subject: feat: initial support of closures Also detection and automatic execution of main function. Make sure that all debug is output to stderr. --- vm/vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm/vm.go') 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]) -- cgit v1.2.3