From 65fa23daa475b3fb8a9922508a980529c74933aa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 2 Apr 2018 08:15:25 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]) -- cgit v1.2.3