From 63153a5541e4bc9ba99a7a48345c6bdc98f425de Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Mon, 27 Mar 2017 22:14:09 -0400 Subject: [PATCH] Fix test failure as a result of #+immobile-code. Normally the trampoline made by INSTALL-GUARD-FUN is a closure that captures SYMBOL, invoking ERROR to construct an UNDEFINED-FUNCTION condition. Immobile-code works differently though: to store a closure as a named function requires consing a new trampoline to call the closure, since we don't load RAX with the address of the callee. But we don't cons anything to install the undefined-tramp asm routine. We use the CALL instruction to get from the fdefn to the asm routine, which pops the return PC to compute the fdefn, and it invokes undefined-fun-error with an fdefn which has a possibly wacky name, if it named a special form, in which case we have to unwacky-ize it. --- src/code/interr.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/code/interr.lisp b/src/code/interr.lisp index 5ba2d9e20..4eb2a421b 100644 --- a/src/code/interr.lisp +++ b/src/code/interr.lisp @@ -127,7 +127,15 @@ (deferr undefined-fun-error (fdefn-or-symbol) (let ((name (etypecase fdefn-or-symbol (symbol fdefn-or-symbol) - (fdefn (fdefn-name fdefn-or-symbol)))) + (fdefn (let ((name (fdefn-name fdefn-or-symbol))) + ;; fasteval stores weird things in the NAME slot + ;; of fdefns of special forms. Have to grab the + ;; special form name out of that. + (cond #!+(and sb-fasteval immobile-code) + ((and (listp name) (functionp (car name))) + (cadr (%fun-name (car name)))) + (t + name)))))) #!+undefined-fun-restarts context) (cond #!+undefined-fun-restarts -- 2.11.4.GIT