The value NIL is not of type SB-C::LVAR (in IR1-OPTIMIZE-IF)

Bug #1886825 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

 (defun bug013 (x y z)
  (when y
    (let* ((v (f1 x))
           (s (f2 v y z))
           (r (f3 v y z)))
      (let ((c
             (when (f4 v (f6 y) z) y))
            (left
             (when r (f5 x (f8 y) z)))
            (right
             (when (and r (not s))
               (f5 x (f7 y) z))))
        (cond
         (right
          (if c
              (cons c right)
              right)))))))

==>

The value
  NIL
is not of type
  SB-C::LVAR
   [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 {101C03D783}>)

Backtrace:
  0: ((FLET "LAMBDA0" :IN "SYS:SRC;COMPILER;IR1OPT.LISP"))
  1: (SB-C::%WITH-IR1-ENVIRONMENT-FROM-NODE #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::CLAMBDA :%SOURCE-NAME SB-C::.ANONYMOUS. :%DEBUG-NAME # :KIND :LET :TYPE #<SB-KERNEL:BUILT-IN-CLASSOID FUNCTIO..
  2: ((FLET SB-C::DO-1-USE :IN SB-C::TENSION-IF-IF-1) #<SB-C::REF :%SOURCE-NAME NIL :LEAF #<SB-KERNEL:CONSTANT :VALUE NIL {101C1DF453}> {101C1F6323}>)
  3: (SB-C::IR1-OPTIMIZE-IF #<SB-C::CIF :TEST #<SB-C::REF :%SOURCE-NAME RIGHT :LEAF #<SB-C::LAMBDA-VAR :%SOURCE-NAME RIGHT {101C1DDC03}> {101C1DE9C3}> :CONSEQUENT #<SB-C::CBLOCK 7 :START c1 {101C1DE7A3}> :..
  4: (SB-C::IR1-OPTIMIZE #<SB-C:COMPONENT :NAME BUG013 {101C204DA3}> NIL)
  5: (SB-C::IR1-OPTIMIZE-UNTIL-DONE #<SB-C:COMPONENT :NAME BUG013 {101C204DA3}>)
  6: (SB-C::IR1-OPTIMIZE-PHASE-1 #<SB-C:COMPONENT :NAME BUG013 {101C204DA3}>)
  7: (SB-C::IR1-PHASES #<SB-C:COMPONENT :NAME BUG013 {101C204DA3}>)
  8: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME BUG013 {101C204DA3}>)
  9: (SB-C::%COMPILE (SB-INT:NAMED-LAMBDA BUG013 (X Y Z) (BLOCK BUG013 (WHEN Y #))) #<SB-C::CORE-OBJECT {101C1CD993}> :NAME NIL :PATH (SB-C::ORIGINAL-SOURCE-START 0 0))

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.