Compiler fails with “The value NIL is not of type SB-C::NODE” on certain combinations of FLET, INLINE, APPLY
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The following function definition makes the compiler fail with the error “The value NIL is not of type SB-C::NODE.”
(defun f (x &rest args)
(flet ((g (&rest args)
(and x args)))
(declare (inline g))
#'g
(apply #'g args)))
This happens both on SBCL 1.1.8 on Darwin (AMD64) and on 1.0.57.0.debian on GNU/Linux (AMD64).
*features* of 1.1.8 on Darwin:
(:SWANK :ASDF2 :ASDF :ASDF-UNICODE :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:BSD :C-STACK-
:COMPLEX-
:GENCGC :IEEE-FLOATING-
:LITTLE-ENDIAN :MACH-EXCEPTION
:MULTIPLY-
:OS-PROVIDES-
:PACKAGE-
:SB-CORE-
:SB-SOURCE-
:SBCL :STACK-
:STACK-
:STACK-
:UNWIND-
*features* of 1.0.57.0.debian:
(:X86-64 :UNIX :ELF :LINUX :LARGEFILE :GENCGC :STACK-
:C-STACK-
:UNWIND-
:STACK-
:STACK-
:CYCLE-COUNTER :COMPLEX-FLOAT-VOPS :FLOAT-EQL-VOPS :INLINE-CONSTANTS
:MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:IEEE-
:SB-PACKAGE-LOCKS :SB-LDB :SB-TEST :SB-DOC :SBCL :COMMON-LISP :ANSI-CL
:SB-CORE-
Changed in sbcl: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: compiler |
Looks like we have an XEP for an &optional entry point that's not marked as being allocated a closure anywhere.
Backtrace:
The value NIL is not of type SB-C::NODE.
[Condition of type TYPE-ERROR]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] Abort thread (#<THREAD "new-repl-thread" RUNNING {100887BC53}>)
Backtrace: NODE-HOME- LAMBDA NIL) [tl,external] &MORE-PROCESSOR (SB-C::LOCAL-INLINE (FLET G :IN F))) :KIND :OPTIO.. %ADD-LAMBDA- VARS-TO- CLOSURES #<SB-C::CLAMBDA :%SOURCE-NAME F :%DEBUG-NAME NIL :KIND :OPTIONAL :TYPE #<SB-KERNEL: BUILT-IN- CLASSOID FUNCTION (read-only)> :WHERE-FROM :DEFINED :VARS (X ARGS #:REST.. ADD-LAMBDA- VARS-AND- LET-VARS- TO-CLOSURES #<SB-C::CLAMBDA :%SOURCE-NAME F :%DEBUG-NAME NIL :KIND :OPTIONAL :TYPE #<SB-KERNEL: BUILT-IN- CLASSOID FUNCTION (read-only)> :WHERE-FROM :DEFINED :VARS (X.. PHYSENV- ANALYZE #<SB-C:COMPONENT :NAME (FLET G :IN F) {1006542363}>) COMPILE- COMPONENT #<SB-C:COMPONENT :NAME (FLET G :IN F) {1006542363}>) NAMED-LAMBDA F (X &REST ARGS) (BLOCK F (FLET ((G (&REST ARGS) (AND X ARGS))) (DECLARE (INLINE G)) (FUNCTION G) (APPLY (FUNCTION G) ARGS)))) #<SB-C::CORE-OBJECT > :NAME NIL :PAT..
0: (SB-C::
1: ((LABELS SB-C::FLOOD :IN SB-C::CLOSE-OVER) #<SB-C::PHYSENV :LAMBDA #<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::XEP (SB-C::LOCAL-INLINE (FLET G :IN F))) :KIND :EXTERNAL :TYPE #<..
2: ((LABELS SB-C::FLOOD :IN SB-C::CLOSE-OVER) #<SB-C::PHYSENV :LAMBDA #<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::
3: ((LABELS SB-C::FLOOD :IN SB-C::CLOSE-OVER) #<SB-C::PHYSENV :LAMBDA #<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::LOCAL-INLINE (FLET G :IN F)) :KIND :OPTIONAL :TYPE #<SB-KERNEL:BU..
4: (SB-C::CLOSE-OVER #<SB-C::LAMBDA-VAR :%SOURCE-NAME X {100650AAE3}> #<SB-C::PHYSENV :LAMBDA #<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME (SB-C::LOCAL-INLINE (FLET G :IN F)) :KIND :OPTIO..
5: (SB-C::
6: (SB-C::
7: (SB-C::
8: (SB-C::
9: (SB-C::%COMPILE (SB-INT: