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
commit65fa23daa475b3fb8a9922508a980529c74933aa (patch)
tree73b48dab68da8dba8b6c4d7f8073bc3bf1cccbd6
parent370821a0c8ef107e8cdc2eb7b648e48a958a59c8 (diff)
downloadtxr-65fa23daa475b3fb8a9922508a980529c74933aa.tar.gz
txr-65fa23daa475b3fb8a9922508a980529c74933aa.tar.bz2
txr-65fa23daa475b3fb8a9922508a980529c74933aa.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])