diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-25 08:02:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-25 08:02:40 -0700 |
commit | 11f7c39c03b7ed2ba5c46dc3d43774311d053c11 (patch) | |
tree | c782cbbcf0c52f3902551c96cca405a18678117f | |
parent | 54eeb47c7fa92280b0b2378feaa914f32e0cadd8 (diff) | |
download | txr-11f7c39c03b7ed2ba5c46dc3d43774311d053c11.tar.gz txr-11f7c39c03b7ed2ba5c46dc3d43774311d053c11.tar.bz2 txr-11f7c39c03b7ed2ba5c46dc3d43774311d053c11.zip |
compiler: setq bug: wrong return for globals.
* share/txr/stdlib/compiler.tl (compiler comp-setq): The
output register of the returned frag must be that of the value
calculating frag, not vloc, because in the dynamic variable
case, vloc holds the d-reg with the variable's name, not the
v-reg that receives its value.
(compiler compl-lisp1-setq): Fix same bug which got propagated
by copy-and-paste coding.
-rw-r--r-- | share/txr/stdlib/compiler.tl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index 3fe8d595..406253a5 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -232,7 +232,7 @@ bind.loc me.(get-dreg sym))) (vfrag me.(compile (if bind vloc oreg) env value))) - (new (frag vloc + (new (frag vfrag.oreg ^(,*vfrag.code ,*(if bind (maybe-mov vloc vfrag.oreg) @@ -249,7 +249,7 @@ ((null bind) (let ((vfrag me.(compile oreg env val)) (l1loc me.(get-dreg sym))) - (new (frag l1loc + (new (frag vfrag.oreg ^(,*vfrag.code (setl1 ,vfrag.oreg ,l1loc)) (uni (list sym) vfrag.fvars) |