Comment 4 for bug 551227

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

A slightly more minimal test case:

#'(lambda (a)
  (if (let ((s a))
        (block :block
          (map nil
               #'(lambda (e)
                   (return-from :block (f (mod a e))))
               s)))
      (g a)))

Any further attempt I've made to reduce the test case caused the bug to disappear.

The failure appears to be that CONSTRAIN-REF-TYPE calls CHANGE-REF-LEAF to alter the A referred to in (G A) to be NUMBER (from the LET-converted inline-expansion of MOD). This leads to the toplevel lambda attempting to CLOSE-OVER a variable from a lambda that is not part of its lexical environment.