summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-19 20:03:55 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-19 20:03:55 -0800
commit458cb61cedcd21d2eea0c8588a2050af2b678dac (patch)
treefd7dab6cfd046a535d276f76f662857424f21624
parent2e565908cf8dcc806c853d6765419546d48d1622 (diff)
downloadtxr-458cb61cedcd21d2eea0c8588a2050af2b678dac.tar.gz
txr-458cb61cedcd21d2eea0c8588a2050af2b678dac.tar.bz2
txr-458cb61cedcd21d2eea0c8588a2050af2b678dac.zip
compiler: prof instruction tries to modify t0.
* share/txr/stdlib/compiler.tl (compiler comp-prof): We must use the incoming oreg as the destination for prof, and not try to use output register indicated by the compiled fragment. That fragment may indicate nil as its output, which we may not clobber. Since we are telling the sub-compile to try to put the fragment's output into our oreg, in most cases they still get merged so a single register is re-used.
-rw-r--r--share/txr/stdlib/compiler.tl4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index da49c873..c68d0f14 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1239,8 +1239,8 @@
(defmeth compiler comp-prof (me oreg env form)
(mac-param-bind form (op . forms) form
(let ((bfrag me.(comp-progn oreg env forms)))
- (new (frag bfrag.oreg
- ^((prof ,bfrag.oreg)
+ (new (frag oreg
+ ^((prof ,oreg)
,*bfrag.code
(end ,bfrag.oreg))
bfrag.fvars bfrag.ffuns)))))