summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-02 08:15:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-02 08:15:25 -0700
commitf4fbc6c4f4fcb6b60ad2e234626f5579e80d1db3 (patch)
tree73b48dab68da8dba8b6c4d7f8073bc3bf1cccbd6
parent2c5795121f4a2052e7bd5c65221cb7d3eb52b685 (diff)
downloadtxr-f4fbc6c4f4fcb6b60ad2e234626f5579e80d1db3.tar.gz
txr-f4fbc6c4f4fcb6b60ad2e234626f5579e80d1db3.tar.bz2
txr-f4fbc6c4f4fcb6b60ad2e234626f5579e80d1db3.zip
compiler: switch bugfix: missing index code.
* share/txr/stdlib/compiler.tl (comp-switch): Emit the code for evaluating the switch index. This has been working by fluke, because when the index is a variable, the assembly code for ifrag is nil; the swtch instruction accesses the variable directly and all is cool.
-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 419af9cb..73258677 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -449,7 +449,8 @@
cfrag.fvars cfrag.ffuns))))))
me.(maybe-free-treg treg oreg)
(new (frag oreg
- ^((swtch ,ifrag.oreg ,*clabels)
+ ^(,*ifrag.code
+ (swtch ,ifrag.oreg ,*clabels)
,*(mappend .code cfrags)
,lend)
(uni ifrag.fvars [reduce-left uni cfrags nil .fvars])