From c716f6ea5255afeb33a1181535b5c067aa9d6aaa Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Sun, 15 Sep 2002 16:32:18 +0000 Subject: [PATCH] 0.7.7.25: merged tonyms "Function constants" patch (sbcl-devel 2002-09-12) --- BUGS | 3 --- src/compiler/ir1opt.lisp | 50 +++++++++++++++++++++++----------------------- src/runtime/GNUmakefile | 4 ++-- tests/compiler.pure.lisp | 6 ++++++ version.lisp-expr | 2 +- 5 files changed, 34 insertions(+), 31 deletions(-) diff --git a/BUGS b/BUGS index d9e91f4..fd8770f 100644 --- a/BUGS +++ b/BUGS @@ -1350,9 +1350,6 @@ WORKAROUND: and LONG-FLOAT left out of the union, this type is equal to REAL. So it'd be better just to say "This is not a REAL". -196: "confusing error message for unREAL second arg to ATAN" - (fixed in sbcl-0.7.7.18) - 197: "failed AVER on compiling or evaluating function constants" (reported by Antonio Martinez sbcl-devel 2002-09-12) When compiling or evaluating function constants, such as in diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index f034d4a..edd5cc4 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -935,31 +935,31 @@ (continuation-use (basic-combination-fun call)) call)) ((not leaf)) - ((or (info :function :source-transform (leaf-source-name leaf)) - (and info - (ir1-attributep (fun-info-attributes info) - predicate) - (let ((dest (continuation-dest (node-cont call)))) - (and dest (not (if-p dest)))))) - (when (and (leaf-has-source-name-p leaf) - ;; FIXME: This SYMBOLP is part of a literal - ;; translation of a test in the old CMU CL - ;; source, and it's not quite clear what - ;; the old source meant. Did it mean "has a - ;; valid name"? Or did it mean "is an - ;; ordinary function name, not a SETF - ;; function"? Either way, the old CMU CL - ;; code probably didn't deal with SETF - ;; functions correctly, and neither does - ;; this new SBCL code, and that should be fixed. - (symbolp (leaf-source-name leaf))) - (let ((dummies (make-gensym-list (length - (combination-args call))))) - (transform-call call - `(lambda ,dummies - (,(leaf-source-name leaf) - ,@dummies)) - (leaf-source-name leaf)))))))))) + ((and (leaf-has-source-name-p leaf) + (or (info :function :source-transform (leaf-source-name leaf)) + (and info + (ir1-attributep (fun-info-attributes info) + predicate) + (let ((dest (continuation-dest (node-cont call)))) + (and dest (not (if-p dest))))))) + ;; FIXME: This SYMBOLP is part of a literal + ;; translation of a test in the old CMU CL + ;; source, and it's not quite clear what + ;; the old source meant. Did it mean "has a + ;; valid name"? Or did it mean "is an + ;; ordinary function name, not a SETF + ;; function"? Either way, the old CMU CL + ;; code probably didn't deal with SETF + ;; functions correctly, and neither does + ;; this new SBCL code, and that should be fixed. + (when (symbolp (leaf-source-name leaf)) + (let ((dummies (make-gensym-list + (length (combination-args call))))) + (transform-call call + `(lambda ,dummies + (,(leaf-source-name leaf) + ,@dummies)) + (leaf-source-name leaf)))))))))) (values)) ;;;; known function optimization diff --git a/src/runtime/GNUmakefile b/src/runtime/GNUmakefile index 29fd1aa..c081c71 100644 --- a/src/runtime/GNUmakefile +++ b/src/runtime/GNUmakefile @@ -62,6 +62,6 @@ depend: ${C_SRCS} sbcl.h $(CC) ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS} ${C_SRCS} > depend.tmp mv -f depend.tmp depend -# By including this file, we cause GNU to automatically make depend if -# it can't find it or it is out of date +# By including this file, we cause GNU make to automatically "make depend" +# if it can't find it or it is out of date. include depend diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 437eef8..47fc4c1 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -162,3 +162,9 @@ (assert (ignore-errors (eval '(lambda (&key (c #\c)) "foo")))) (assert (null (ignore-errors (eval '(lambda (&key ((#\c #\c) #\c)) "foo"))))) (assert (ignore-errors (eval '(lambda (&key ((:c cbyanyothername) #\c)) "foo")))) + +;;; As reported and fixed by Antonio Martinez-Shotton sbcl-devel +;;; 2002-09-12, this failed in sbcl-0.7.7.23. (with failed AVER +;;; "(LEAF-HAS-SOURCE-NAME-P LEAF)") +(assert (= (funcall (eval `(lambda (x) (funcall ,(lambda (y) (+ y 3)) x))) 14) + 17)) diff --git a/version.lisp-expr b/version.lisp-expr index f993ac3..0e50f7e 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.7.24" +"0.7.7.25" -- 1.7.10.4