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
commitb434af5cb21ac4bf8e78639c15fadde9f66f5068 (patch)
tree4fc468bf545ff377d6ed5332aea87242bbc7da4b
parent80e98ecc40883d9f153ef7a06fdda1d659389b8a (diff)
downloadtxr-b434af5cb21ac4bf8e78639c15fadde9f66f5068.tar.gz
txr-b434af5cb21ac4bf8e78639c15fadde9f66f5068.tar.bz2
txr-b434af5cb21ac4bf8e78639c15fadde9f66f5068.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)))))