function %THROW, unknown values stack after the call is empty, so
the unknown values LVAR (*) is considered to be dead after the call
and, thus, before it and is popped by the stack analysis.
+
+300: (reported by Peter Graves) Function PEEK-CHAR checks PEEK-TYPE
+ argument type only after having read a character. This is caused
+ with EXPLICIT-CHECK attribute in DEFKNOWN. The similar problem
+ exists with =, /=, <, >, <=, >=. They were fixed, but it is probably
+ less error prone to have EXPLICIT-CHECK be a local declaration,
+ being put into the definition, instead of an attribute being kept in
+ a separate file; maybe also put it into SB-EXT?
(thanks to Vincent Arkesteijn)
* optimization: implemented multiplication as a modular
(UNSIGNED-BYTE 32) operation on the x86 backend.
+ * bug fix: functions =, /=, <, <=, >, >= did not check the argument
+ type when called with 1 argument; PEEK-CHAR checked type of
+ PEEK-TYPE only after having read first character from a
+ stream. (reported by Peter Graves)
planned incompatible changes in 0.8.x:
* (not done yet, but planned:) When the profiling interface settles
(defun = (number &rest more-numbers)
#!+sb-doc
"Return T if all of its arguments are numerically equal, NIL otherwise."
+ (the number number)
(do ((nlist more-numbers (cdr nlist)))
((atom nlist) T)
(declare (list nlist))
(defun /= (number &rest more-numbers)
#!+sb-doc
"Return T if no two of its arguments are numerically equal, NIL otherwise."
- (do* ((head number (car nlist))
+ (do* ((head (the number number) (car nlist))
(nlist more-numbers (cdr nlist)))
((atom nlist) t)
(declare (list nlist))
(defun < (number &rest more-numbers)
#!+sb-doc
"Return T if its arguments are in strictly increasing order, NIL otherwise."
- (do* ((n number (car nlist))
+ (do* ((n (the number number) (car nlist))
(nlist more-numbers (cdr nlist)))
((atom nlist) t)
(declare (list nlist))
(defun > (number &rest more-numbers)
#!+sb-doc
"Return T if its arguments are in strictly decreasing order, NIL otherwise."
- (do* ((n number (car nlist))
+ (do* ((n (the number number) (car nlist))
(nlist more-numbers (cdr nlist)))
((atom nlist) t)
(declare (list nlist))
(defun <= (number &rest more-numbers)
#!+sb-doc
"Return T if arguments are in strictly non-decreasing order, NIL otherwise."
- (do* ((n number (car nlist))
+ (do* ((n (the number number) (car nlist))
(nlist more-numbers (cdr nlist)))
((atom nlist) t)
(declare (list nlist))
(defun >= (number &rest more-numbers)
#!+sb-doc
"Return T if arguments are in strictly non-increasing order, NIL otherwise."
- (do* ((n number (car nlist))
+ (do* ((n (the number number) (car nlist))
(nlist more-numbers (cdr nlist)))
((atom nlist) t)
(declare (list nlist))
eof-value
recursive-p)
(declare (ignore recursive-p))
+ (the (or character boolean) peek-type)
(let ((stream (in-synonym-of stream)))
(cond ((typep stream 'echo-stream)
(echo-misc stream
(truncate (expt a b))))
(assert (equal (multiple-value-list (expt-derive-type-bug 1 1))
'(1 0)))
+
+;;; Problems with type checking in functions with EXPLICIT-CHECK
+;;; attribute (reported by Peter Graves)
+(loop for (fun . args) in '((= a) (/= a)
+ (< a) (<= a) (> a) (>= a))
+ do (assert (raises-error? (apply fun args) type-error)))
+
+(defclass broken-input-stream (sb-gray:fundamental-input-stream) ())
+(defmethod sb-gray:stream-read-char ((stream broken-input-stream))
+ (throw 'break :broken))
+(assert (eql (block return
+ (handler-case
+ (catch 'break
+ (funcall (eval ''peek-char)
+ 1 (make-instance 'broken-input-stream))
+ :test-broken)
+ (type-error (c)
+ (return-from return :good))))
+ :good))
+
\f
;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself
(compilation-speed 1)))
(logand a (* a 438810))))
215067723)
- 13739018))
\ No newline at end of file
+ 13739018))
+