NIL fell through ETYPECASE expression. Wanted one of (FIXNUM BIGNUM).

Bug #1389433 reported by Paul F. Dietz on 2014-11-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Medium
Unassigned

Bug Description

Found using the random tester (SBCL 1.2.5).

(defparameter *f4*
  '(lambda (b c)
    (declare (optimize (speed 2) (space 0) (safety 0) (debug 1)
       (compilation-speed 3)))
    (block b8
       (flet ((%f7 (&key (key2 (return-from b8 b)))
    (logxor key2)))
    (logior (%f7) c)))))

#|

* (compile nil *f4*)

debugger invoked on a SB-KERNEL:CASE-FAILURE in thread
#<THREAD "main thread" RUNNING {1003016813}>:
  NIL fell through ETYPECASE expression. Wanted one of (FIXNUM BIGNUM).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-KERNEL:CASE-FAILURE ETYPECASE NIL (FIXNUM BIGNUM))
0]

|#

Stas Boukarev (stassats) wrote :

This is due to bad type and constant propagation, at first it things it'll return an integer, then it figures it'll be a constant, but still applies the transform as if it were an integer.

reduced:
(lambda (c)
  (block nil
    (flet ((f (x)
             (unless x
               (return))
             (the integer x)))
      (logior c (f nil)))))

Changed in sbcl:
importance: Undecided → Critical
importance: Critical → Medium
status: New → Triaged
Stas Boukarev (stassats) wrote :

In c23a3c04d55c74e1d12f6d1b32f07a9c976b4140

Changed in sbcl:
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers