Incorrect type error reported

Bug #1838808 reported by Paul F. Dietz on 2019-08-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

(defun f378 (p1 p2 q)
  (declare (type (eql #.(symbol-function 'symbolp)) p1))
  (flet ((%f (x) (the function x)))
    (funcall
     (if q
         (%f p1)
         (%f #'cddar))
     (the real p2))))

(compiles, with warnings)

(f378 (symbol-function 'symbolp) 1 t) ==>

Value of P2 in
(SB-C::%FUNCALL
 (SB-KERNEL:%COERCE-CALLABLE-FOR-CALL
  (IF Q
      (%F P1)
      (%F #'CDDAR)))
 (THE REAL P2))

is
  1,
not a
  LIST.
   [Condition of type SIMPLE-TYPE-ERROR]

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

Backtrace:
  0: (SB-C::%COMPILE-TIME-TYPE-ERROR (1) LIST #<unused argument> (P2) "(SB-C::%FUNCALL ..)
  1: (F378 #<FUNCTION SYMBOLP> 1 T)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (F378 (SYMBOL-FUNCTION (QUOTE SYMBOLP)) 1 T) #<NULL-LEXENV>)
  3: (EVAL (F378 (SYMBOL-FUNCTION (QUOTE
[...]

Paul F. Dietz (paul-f-dietz) wrote :

Perhaps related?

(defun f380 (p2 q)
  (declare (type (eql -3759458699) p2))
  (logxor 149
          (the (member 1 -3759458699)
               (flet ((%f (x) (the (or number (array *)) x)))
                 (if q
                     (%f p2)
                     (%f (make-array '(2 1) :adjustable t)))))))

;; (f380 -3759458699 t) ==> unhandled memory fault

Stas Boukarev (stassats) wrote :

No, that's not related.

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats) wrote :

f46a965c01c9c0e7963bcbfdbbdca7e42b8c66cd

Paul F. Dietz (paul-f-dietz) wrote :

The other bug has been moved to 1838827

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers