summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-02 08:28:33 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-02 08:28:33 -0700
commitb1b5cfea76b05ff965ba42cc31e53577030d991e (patch)
tree4fc468bf545ff377d6ed5332aea87242bbc7da4b
parent39d64522a08df4cd3b9ed3c712e7626a17055b4e (diff)
downloadtxr-b1b5cfea76b05ff965ba42cc31e53577030d991e.tar.gz
txr-b1b5cfea76b05ff965ba42cc31e53577030d991e.tar.bz2
txr-b1b5cfea76b05ff965ba42cc31e53577030d991e.zip
compiler: bugfix: block: missing mov to oreg.
* share/txr/stdlib/compiler.tl (comp-block): Our output frag indicates that oreg is the output register, and in the case when the block is terminated by the dynamic return, that's where it stores the result value before branching to the skip address. In the ordinary termination case, we have neglected to move the output of the block's code from bfrag.oreg to the output register oreg.
-rw-r--r--share/txr/stdlib/compiler.tl3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 986ebb7e..fd315944 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -501,7 +501,8 @@
^(,*(if nfrag nfrag.code)
(block ,oreg ,nreg ,lskip)
,*bfrag.code
- (end ,bfrag.oreg)
+ ,*(maybe-mov oreg bfrag.oreg)
+ (end ,oreg)
,lskip)
bfrag.fvars
bfrag.ffuns)))))