From ad4fd20de698fe853fb8aec3d49e51e369771b31 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 16 Feb 2011 10:35:57 +0000 Subject: [PATCH] 1.0.45.35: revert 1.0.45.30 due to regression (lp#677779) Reported by Ariel Badichi on sbcl-devel. Using WITH-COMPILATION-UNIT to silence UNDEFINED-FUNCTION style-warnings for forward-referenced functions was a bad idea after all: it caused cores dumped using it to be started with **WORLD-LOCK** held by a dead thread. ...and it's not like WITH-COMPILATION-UNIT would ever get to summarize the unit anyways the way it was used there. Proper fix for this is to use UNDEFINED-REFERENCE-STYLE-WARNING as separate condition class and just muffle those -- but this is too much to put in during the freeze and will wait till after 1.0.46. --- NEWS | 2 -- src/code/late-extensions.lisp | 13 ------------- src/code/toplevel.lisp | 10 +++++++++- tests/script.test.sh | 6 ------ version.lisp-expr | 2 +- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/NEWS b/NEWS index ad1a3da..466191b 100644 --- a/NEWS +++ b/NEWS @@ -3,8 +3,6 @@ changes relative to sbcl-1.0.45: * enhancement: largefile support on Solaris. * enhancement: SB-PROFILE:REPORT now supports :LIMIT and :PRINT-NO-CALL-LIST arguments (lp#710017) - * enhancement: forward referenced functions no longer cause STYLE-WARNINGS - when running under --script. (lp#677779) * enhancement: SB-PCL:+SLOT-UNBOUND+ is exported, making it possible to distinguish unbound instance slots when using STANDARD-INSTANCE-ACCESS &co. (lp#718039) diff --git a/src/code/late-extensions.lisp b/src/code/late-extensions.lisp index 21df767..5d2d598 100644 --- a/src/code/late-extensions.lisp +++ b/src/code/late-extensions.lisp @@ -344,16 +344,3 @@ See also the declarations SB-EXT:GLOBAL and SB-EXT:ALWAYS-BOUND." (sb!c:with-source-location (source-location) (setf (info :source-location :variable name) source-location)) name) - -;;; Needs WITH-COMPILATION-UNIT, hence not in toplevel.lisp. -(defun load-script (pathname) - ;; WITH-COMPILATION-UNIT to avoid style-warnings for - ;; forward-referenced functions in scripts. Needs to be around - ;; HANDLING-END-OF-THE-WORLD so that we don't unwind from it, which - ;; would cause a bogus complaint about a fatal error... - (sb!xc:with-compilation-unit () - (handling-end-of-the-world - (with-open-file (f pathname :element-type :default) - (sb!fasl::maybe-skip-shebang-line f) - (load f :verbose nil :print nil)) - (quit)))) diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 2749322..0868844 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -292,6 +292,14 @@ any non-negative real number." (dolist (option options) (process-1 option))))) +(defun process-script (script) + (let ((pathname (native-pathname script))) + (handling-end-of-the-world + (with-open-file (f pathname :element-type :default) + (sb!fasl::maybe-skip-shebang-line f) + (load f :verbose nil :print nil) + (quit))))) + ;; Errors while processing the command line cause the system to QUIT, ;; instead of trying to go into the Lisp debugger, because trying to ;; go into the Lisp debugger would get into various annoying issues of @@ -438,7 +446,7 @@ any non-negative real number." (process-init-file userinit :user)) (process-eval/load-options (nreverse reversed-options)) (when script - (load-script (native-pathname script)) + (process-script script) (bug "PROCESS-SCRIPT returned"))) (abort () :report (lambda (s) diff --git a/tests/script.test.sh b/tests/script.test.sh index 87061f6..a9ce19a 100644 --- a/tests/script.test.sh +++ b/tests/script.test.sh @@ -31,12 +31,6 @@ echo 'nil'> $tmpscript run_sbcl --script $tmpscript check_status_maybe_lose "--script exit status from normal exit" $? 0 "(everything ok)" -echo '(setf *error-output* *standard-output*) (defun foo () (bar)) (defun bar () 11) (quit :unix-status (foo))'> $tmpscript -out=`run_sbcl --script $tmpscript` -check_status_maybe_lose "--script exit status from normal exit" $? 11 "(everything ok)" -test -z "$out" -check_status_maybe_lose "--script forward-referenced functions" $? 0 "(everything ok)" - rm -f $tmpscript exit $EXIT_TEST_WIN diff --git a/version.lisp-expr b/version.lisp-expr index 5d5f971..a9892f9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -20,4 +20,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".) -"1.0.45.34" +"1.0.45.35" -- 1.7.10.4