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 | 23a7e6356156fe16686b7f5e372e9379776645f8 (patch) | |
tree | c782cbbcf0c52f3902551c96cca405a18678117f | |
parent | 4ddec63afdb50cc252bb4396d6cdc0d866c2adfc (diff) | |
download | txr-23a7e6356156fe16686b7f5e372e9379776645f8.tar.gz txr-23a7e6356156fe16686b7f5e372e9379776645f8.tar.bz2 txr-23a7e6356156fe16686b7f5e372e9379776645f8.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) |