From b434af5cb21ac4bf8e78639c15fadde9f66f5068 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 2 Apr 2018 08:28:33 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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))))) -- cgit v1.2.3