From: Alexey Dejneka Date: Mon, 30 Sep 2002 03:35:49 +0000 (+0000) Subject: 0.7.8.7: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=96b310113978665980a8d65ad5dd83deab05c28b;p=sbcl.git 0.7.8.7: Fixed bug 202: compiler failure on a function definition, incompatible with the declared type. --- diff --git a/BUGS b/BUGS index de90432..9577381 100644 --- a/BUGS +++ b/BUGS @@ -1240,27 +1240,13 @@ WORKAROUND: (FOO ' (1 . 2)) => "NIL IS INTEGER, Y = 1" -202: - In 0.6.12.43 compilation of a function definition, contradicting its - FTYPE proclamation, causes an error, e.g. COMPILE-FILE on +203: + Compiler does not check THEs on unused values, e.g. in - (declaim (ftype (function () null) foo)) - (defun foo () t) + (progn (the real (list 1)) t) - fails with - - debugger invoked on condition of type UNBOUND-VARIABLE: - The variable SB-C::*ERROR-FUNCTION* is unbound. - - in - - (SB-C::NOTE-LOSSAGE - "~@" - (FUNCTION NIL NULL) - (FUNCTION NIL #)) - - (In 0.7.0 the variable was renamed to SB-C::*LOSSAGE-FUN*.) + This situation may appear during optimizing away degenerate cases of + certain functions: see bugs 54, 192b. DEFUNCT CATEGORIES OF BUGS IR1-#: diff --git a/NEWS b/NEWS index 5c4a21c..e470949 100644 --- a/NEWS +++ b/NEWS @@ -1304,6 +1304,8 @@ changes in sbcl-0.7.9 relative to sbcl-0.7.8: Froyd porting Raymond Toy's fix to CMU CL) * improved MOP conformance in PCL (thanks to Nathan Froyd porting Gerd Moellman's work in CMU CL) + * fixed bug 202: the compiler failed on a function, which derived + type contradicted declared. planned incompatible changes in 0.7.x: * When the profiling interface settles down, maybe in 0.7.x, maybe diff --git a/src/compiler/ir1final.lisp b/src/compiler/ir1final.lisp index 055322b..94240a0 100644 --- a/src/compiler/ir1final.lisp +++ b/src/compiler/ir1final.lisp @@ -80,10 +80,11 @@ (let ((declared-ftype (info :function :type source-name))) (unless (defined-ftype-matches-declared-ftype-p defined-ftype declared-ftype) - (note-lossage "~@" - (type-specifier declared-ftype) - (type-specifier defined-ftype))))) + (compiler-style-warn + "~@" + (type-specifier declared-ftype) + (type-specifier defined-ftype))))) (:defined (when global-p (setf (info :function :type source-name) defined-ftype)))))))) diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index d9ea3fb..98837d1 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -420,6 +420,12 @@ BUG 48c, not yet fixed: (ignore-errors (bug110 0)) (declare (ignore result)) (assert (typep condition 'type-error))) + +;;; bug 202: the compiler failed to compile a function, which derived +;;; type contradicted declared. +(declaim (ftype (function () null) bug202)) +(defun bug202 () + t) ;;;; tests not in the problem domain, but of the consistency of the ;;;; compiler machinery itself diff --git a/version.lisp-expr b/version.lisp-expr index 8ea633f..c7bc9ab 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; internal versions off the main CVS branch, it gets hairier, e.g. ;;; "0.pre7.14.flaky4.13".) -"0.7.8.6" +"0.7.8.7"