Type error from bad SVREF call escapes compiler

Bug #1881198 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 bug008 (n)
  (let ((p (make-array n :initial-element nil)))
    (unless (svref p 0)
      (svref p nil))))

==>

The value
  NIL
is not of type
  REAL
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT] Exit debugger, returning to top level.

Backtrace:
  0: ((SB-C:DEFTRANSFORM SB-KERNEL:%CHECK-BOUND) #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME SB-KERNEL:%CHECK-BOUND :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHER..
  1: (SB-C::IR1-OPTIMIZE-COMBINATION #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME SB-KERNEL:%CHECK-BOUND :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHERE-FROM :DECL..
  2: (SB-C::IR1-OPTIMIZE #<SB-C:COMPONENT :NAME BUG008 :REANALYZE T {101EA2E363}> NIL)
  3: (SB-C::IR1-OPTIMIZE-UNTIL-DONE #<SB-C:COMPONENT :NAME BUG008 :REANALYZE T {101EA2E363}>)
  4: (SB-C::IR1-OPTIMIZE-PHASE-1 #<SB-C:COMPONENT :NAME BUG008 :REANALYZE T {101EA2E363}>)
  5: (SB-C::IR1-PHASES #<SB-C:COMPONENT :NAME BUG008 :REANALYZE T {101EA2E363}>)
  6: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME BUG008 :REANALYZE T {101EA2E363}>)
[...]

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