summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-04-17 18:12:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-04-17 18:12:44 -0700
commit533331cecacf84464eea5dc5c856309027fe7297 (patch)
treedb1a697ab17ddb91ac41ce6537451589faef1374
parenta2b107b61b1fa7d2ac7689b93ac3fcd124c842fe (diff)
downloadtxr-533331cecacf84464eea5dc5c856309027fe7297.tar.gz
txr-533331cecacf84464eea5dc5c856309027fe7297.tar.bz2
txr-533331cecacf84464eea5dc5c856309027fe7297.zip
compiler: bugfix: lingering funarg eval order issue.
* stdlib/compiler.tl (compiler comp-call-impl): We can no longer free the temporary registers as-we-go based on whether the argument expression frag uses them as the output register frag. Let's just put them all into the aoregs list to be freed afterward.
-rw-r--r--stdlib/compiler.tl4
1 files changed, 1 insertions, 3 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index b09324f9..913263a3 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -1496,9 +1496,7 @@
(afrags0 (collect-each ((arg args))
(let* ((aoreg me.(alloc-treg))
(afrag me.(compile aoreg env arg)))
- (if (nequal afrag.oreg aoreg)
- me.(free-treg aoreg)
- (push aoreg aoregs))
+ (push aoreg aoregs)
afrag)))
(afrags (handle-mutated-var-args afrags0 spy.mutated-vars))
(fvars [reduce-left uni afrags nil .fvars])