From 9c7b8638313069c25a9718985720d69c9f4a1cda Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 21 Dec 2002 10:53:28 +0000 Subject: [PATCH] 0.7.10.29: Fix compiler crash in new COERCE defoptimizer ... CAREFUL-SPECIFIER-TYPE can return NIL, so handle that case too. (Might it not be nice to provide a compiler warning? Or should that be left to the IR1-TRANSFORM?) --- src/compiler/srctran.lisp | 1 + tests/compiler.impure.lisp | 9 ++++++++- version.lisp-expr | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index cd363e2..0661685 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3245,6 +3245,7 @@ (let* ((specifier (continuation-value type)) (result-typeoid (careful-specifier-type specifier))) (cond + ((null result-typeoid) nil) ((csubtypep result-typeoid (specifier-type 'number)) ;; the difficult case: we have to cope with ANSI 12.1.5.3 ;; Rule of Canonical Representation for Complex Rationals, diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 869cd5a..46f15ef 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -719,7 +719,14 @@ BUG 48c, not yet fixed: (assert (equal (bug223-int 4) '(ext int 3))) (bug223-wrap) (assert (equal (bug223-int 4) '(ext ext int 2))) - + +;;; COERCE got its own DEFOPTIMIZER which has to reimplement most of +;;; SPECIFIER-TYPE-NTH-ARG. For a while, an illegal type would throw +;;; you into the debugger on compilation. +(defun coerce-defopt (x) + ;; illegal, but should be compilable. + (coerce x '(values t))) +(assert (null (ignore-errors (coerce-defopt 3)))) ;;;; 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 b53fc05..881182a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.10.28" +"0.7.10.29" -- 1.7.10.4