From e2470cd3c62342d574cc80a621f29d7530345817 Mon Sep 17 00:00:00 2001 From: Alexey Dejneka Date: Sat, 6 Nov 2004 04:45:05 +0000 Subject: [PATCH] 0.8.16.33: * Fix MISC.320: forbid intercomponent reference of a DEFINED-FUN-FUNCTIONAL. --- NEWS | 2 ++ src/compiler/ir1tran.lisp | 9 ++++++++- tests/compiler.pure.lisp | 13 +++++++++++++ version.lisp-expr | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 03e3eba..3c0cb1a 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,8 @@ changes in sbcl-0.8.17 relative to sbcl-0.8.16: characters. ** The REAL type specifier handles bounds outside the floating point ranges without signalling FLOATING-POINT-OVERFLOW. + ** Functions with IR1-transformations can create intercomponent + references to global functions. changes in sbcl-0.8.16 relative to sbcl-0.8.15: * enhancement: saving cores with foreign code loaded is now diff --git a/src/compiler/ir1tran.lisp b/src/compiler/ir1tran.lisp index 340a739..45b1de9 100644 --- a/src/compiler/ir1tran.lisp +++ b/src/compiler/ir1tran.lisp @@ -576,7 +576,14 @@ :notinline)) (let ((functional (defined-fun-functional leaf))) (when (and functional - (not (functional-kind functional))) + (not (functional-kind functional)) + ;; Bug MISC.320: ir1-transform + ;; can create a reference to a + ;; inline-expanded function, + ;; defined in another component. + (not (and (lambda-p functional) + (neq (lambda-component functional) + *current-component*)))) (maybe-reanalyze-functional functional)))) (when (and (lambda-p leaf) (memq (functional-kind leaf) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index e9ca625..ac701a6 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1605,3 +1605,16 @@ '(lambda (s ei x y) (declare (type (simple-array function (2)) s) (type ei ei)) (funcall (aref s ei) x y)))) + +;;; MISC.320: ir1-transform can create an intercomponent reference to +;;; a DEFINED-FUN. +(assert (eql 102 (funcall + (compile + nil + '(lambda () + (declare (optimize (speed 3) (space 0) (safety 2) + (debug 2) (compilation-speed 0))) + (catch 'ct2 + (elt '(102) + (flet ((%f12 () (rem 0 -43))) + (multiple-value-call #'%f12 (values)))))))))) diff --git a/version.lisp-expr b/version.lisp-expr index c15a297..1939c70 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.16.32" +"0.8.16.33" -- 1.7.10.4