summaryrefslogtreecommitdiff
path: root/vm/vm.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2026-01-26 18:44:29 +0100
committerMarc Vertes <mvertes@free.fr>2026-01-26 18:44:29 +0100
commitaa5861917ac2543f85bf4cfefbb69cf501d4de41 (patch)
tree94122ea3167c295da822f03d075a085b4f87e9ea /vm/vm.go
parentece8bdbc45afc3ea626db884ea3283d9a8395ae5 (diff)
fix: improve multi assignHEADmain
Do not consider assign operators in expression handling, they are part of statements. Isolate parsing of left hand side and right hand side in assignments.
Diffstat (limited to 'vm/vm.go')
-rw-r--r--vm/vm.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/vm/vm.go b/vm/vm.go
index fac1a53..f5bb78e 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -150,8 +150,7 @@ func (m *Machine) Run() (err error) {
case Deref:
mem[sp-1].Value = mem[sp-1].Value.Elem()
case Dup:
- k := c.Arg[0]
- mem = append(mem, mem[k])
+ mem = append(mem, mem[c.Arg[0]])
case New:
mem[c.Arg[0]+fp-1] = NewValue(mem[c.Arg[1]].Type)
case Equal: