Comment 1 for bug 1523149

Revision history for this message
Stas Boukarev (stassats) wrote : Re: substitute-let-funargs causing a failed AVER

It is influenced by %coerce-callable-to-fun
(declaim (inline bar))
(defun bar (f)
  (%funcall f))

(defun foo ()
  ((lambda ()
     (declare (optimize debug))
     (block nil
       (flet ((fun () (return nil)))
         (declare (inline fun))
         (bar #'fun))))))

Doesn't fail

while
(defun bar (f)
  (%funcall (%coerce-callable-to-fun f)))
does with
    (NOT (FUNCTIONAL-HAS-EXTERNAL-REFERENCES-P CLAMBDA))

doing
(defknown x (t) t)
(deftransform x ((fun))
  'fun)

(defun bar (f)
  (%funcall (x f)))

gives failed AVER: (SUBSETP END END-STACK)

the difference is %coerce-callable-to-fun gives up once