Subject: bug#12883: [2.0.6] CSE bug

From: [email-masked] (Ludovic Courtès)
Date: Thu, 15 Nov 2012 17:24:40 +0100

Hi Stefan!

Stefan Israelsson Tampe <[email-masked]> skribis:

> --- a/module/language/tree-il/cse.scm
> +++ b/module/language/tree-il/cse.scm
> @@ -324,10 +324,11 @@
>                 (and (< n env-len)
>                      (match (vlist-ref env n)
>                        ((#(exp* name sym db-len*) . h*)
> -                       (and (unroll db m (- db-len db-len*))
> -                            (if (and (= h h*) (tree-il=? exp* exp))
> -                                (make-lexical-ref (tree-il-src exp) name sym)
> -                                (lp (1+ n) (- db-len db-len*))))))))))))
> +                       (let ((niter (- (- db-len db-len*) m)))
> +                         (and (unroll db m (- db-len db-len*))
> +                              (if (and (= h h*) (tree-il=? exp* exp))
> +                                  (make-lexical-ref (tree-il-src exp) name sym)
> +                                  (lp (1+ n) (- db-len db-len*)))))))))))))
>  
>    (define (lookup-lexical sym env)
>      (let ((env-len (vlist-length env)))

Hmm, the only thing it changes is that an unused variable is introduced,
no?  Am I missing something?

Thanks,
Ludo’.