Skip to content

Commit

Permalink
1.0.31.31: SATISFIES cannot refer to local functions
Browse files Browse the repository at this point in the history
 * Fix misoptimization: use SB-C::GLOBAL-FUNCTION instead of
   CL:FUNCTION. (Reported by Stanislaw Halik)

 * Also fix a typo in the COMPARE-AND-SWAP docstring. (Thanks to Larry
   Valkama.)
  • Loading branch information
nikodemus committed Oct 7, 2009
1 parent 3ff82c6 commit 5a9a81c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -24,6 +24,8 @@ changes relative to sbcl-1.0.31
* bug fix: Have RUN-PROGRAM with :INPUT T only run the subprocess in a
new process group if it doesn't need to share stdin with the sbcl
process. (thanks to Leslie Polzer)
* bug fix: SATISFIES could be misoptimized to refer to a local function.
(reported by Stanislaw Halik)

changes in sbcl-1.0.31 relative to sbcl-1.0.30:
* improvement: stack allocation is should now be possible in all nested
Expand Down
2 changes: 1 addition & 1 deletion src/code/late-extensions.lisp
Expand Up @@ -76,7 +76,7 @@
(defmacro compare-and-swap (place old new &environment env)
"Atomically stores NEW in PLACE if OLD matches the current value of PLACE.
Two values are considered to match if they are EQ. Returns the previous value
of PLACE: if the returned value if EQ to OLD, the swap was carried out.
of PLACE: if the returned value is EQ to OLD, the swap was carried out.
PLACE must be an accessor form whose CAR is one of the following:
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/typetran.lisp
Expand Up @@ -238,7 +238,8 @@
`(%typep ,object ',spec))
(t
(ecase (first spec)
(satisfies `(if (funcall #',(second spec) ,object) t nil))
(satisfies
`(if (funcall (global-function ,(second spec)) ,object) t nil))
((not and)
(once-only ((n-obj object))
`(,(first spec) ,@(mapcar (lambda (x)
Expand Down
13 changes: 13 additions & 0 deletions tests/compiler.pure.lisp
Expand Up @@ -3347,3 +3347,16 @@
(test 'simple-string "%CONCATENATE-TO-STRING")
(test 'base-string "%CONCATENATE-TO-BASE-STRING")
(test 'simple-base-string "%CONCATENATE-TO-BASE-STRING")))

(with-test (:name :satisfies-no-local-fun)
(let ((fun (compile nil `(lambda (arg)
(labels ((local-not-global-bug (x)
t)
(bar (x)
(typep x '(satisfies local-not-global-bug))))
(bar arg))))))
(assert (eq 'local-not-global-bug
(handler-case
(funcall fun 42)
(undefined-function (c)
(cell-error-name c)))))))
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -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".)
"1.0.31.30"
"1.0.31.31"

0 comments on commit 5a9a81c

Please sign in to comment.