The value NIL is not of type SB-KERNEL:CTYPE (in LOGBITP type derivation)

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

Bug Description

(lambda (b c)
  (declare (type fixnum b))
  (declare
   (optimize (safety 0) (compilation-speed 2) (debug 0)
             (space 0) (speed 3)))
  (logbitp 0
           (if (find c '(0))
               (max (ignore-errors c) 0)
               b)))

==>

The value
  NIL
is not of type
  SB-KERNEL:CTYPE
when binding SB-KERNEL::TYPE1
   [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 tid=4257 "repl-thread" RUNNING {100953C9E3}>)

Backtrace:
  0: (SB-KERNEL:TYPE= NIL #<SB-KERNEL:NUMERIC-TYPE (INTEGER 0 0)>) [external]
  1: (SB-C::LOGBITP-DERIVE-TYPE-OPTIMIZER #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME LOGBITP :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHERE-FROM :DECLARED :KIND..
  2: ((FLET SB-C::PROCESS-INFO :IN SB-C::IR1-OPTIMIZE-COMBINATION))
  3: (SB-C::IR1-OPTIMIZE-COMBINATION #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME LOGBITP :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHERE-FROM :DECLARED :KIND :GLO..
  4: (SB-C::IR1-OPTIMIZE #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {100A887B93}> NIL)
  5: (SB-C::IR1-OPTIMIZE-UNTIL-DONE #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {100A887B93}>)
  6: (SB-C::IR1-OPTIMIZE-PHASE-1 #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {100A887B93}>)
  7: (SB-C::IR1-PHASES #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {100A887B93}>)
  8: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "<unknown>" :REANALYZE T {100A887B93}>)
[...]

x86-64, "2.3.9.36-1d743e96c"

Important note: this test input was an example input for bug #1824351. It is now stimulating a different bug. This demonstrates the utility of adding these inputs as regression tests -- it would have caught this bug. I found this when manually running that old test input.

Stas Boukarev (stassats)
Changed in sbcl:
status: New → Fix Committed
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.