[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A bug in KCL affecting the 2/6/90 PCL



There is a bug in KCL and in every version of AKCL that prevents
the new PCL ("2/6/90  A PCL for the 90's (beta)") from compiling. 
Below are two test cases for this bug which return 1 when uncompiled, 
and return NIL when compiled; and also the fix for this bug.

(defun z ()
  (let ((v 1))
    (labels ((f (&aux r)
               (multiple-value-prog1
                   nil
                 (setq r (g)))
               r)
             (g ()
               v))
      (f))))

(defun q  ()
  (let ((z 1)) 
    (labels ((f ()
	       (labels ((g () (h)))
		 (g)))
	     (h () z))
      (f))))

compiler::c2-call-local (at the end of cmpnew/flet.lsp)
change the lines:
   (t (push-args args)
      (wt-nl "L" (fun-cfun (car fd)) "(")
      (dotimes** (n (fun-level (car fd))) (wt "base" n ","))
      (wt "base")
      (unless (= (fun-level (car fd)) *level*) (wt (1- *level*)))
      (wt ");")
      (base-used)))
to:
   (t (push-args args)
      (wt-nl "L" (fun-cfun (car fd)) "(")
      (dotimes** (n (fun-level (car fd))) (wt "base" n ","))
      (wt "base")
      (unless (= (fun-level (car fd)) *level*) (wt (fun-level (car fd))))
      (wt ");")
      (base-used)))
 ----
 Rick Harris