0.8.5.50:
authorWilliam Harold Newman <william.newman@airmail.net>
Sat, 22 Nov 2003 02:40:12 +0000 (02:40 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Sat, 22 Nov 2003 02:40:12 +0000 (02:40 +0000)
nikodemus siivola patch from sbcl-devel 2003-11-18: tweaked
lookup order for alien variables to cope with loading
foreign libraries

src/code/foreign.lisp
tests/foreign.test.sh
version.lisp-expr

index 54ae8b0..cac9887 100644 (file)
   ;; that the list isn't guaranteed to be in reverse order of loading,
   ;; at least not if a file is loaded more than once. Is this the
   ;; right thing? (In what cases does it matter?)
-  (dolist (handle *handles-from-dlopen*)
+  (dolist (handle (reverse *handles-from-dlopen*))
     ;; KLUDGE: We implicitly exclude the possibility that the variable
     ;; could actually be NULL, but the man page for dlsym(3) 
     ;; recommends doing a more careful test. -- WHN 20000825
index ee78f51..89f98d7 100644 (file)
@@ -24,6 +24,8 @@ ld -shared -o $testfilestem.so $testfilestem.o
 
 # Test interaction with the shared object file.
 ${SBCL:-sbcl} <<EOF
+  (define-alien-variable environ (* c-string))
+  (defvar *environ* environ)
   (handler-case 
       (load-foreign '("$testfilestem.so"))
     (sb-int:unsupported-operator ()
@@ -31,6 +33,11 @@ ${SBCL:-sbcl} <<EOF
      ;; on every OS. In that case, there's nothing to test, and we
      ;; can just fall through to success.
      (sb-ext:quit :unix-status 52))) ; success convention for Lisp program
+  ;; Test that loading an object file didn't screw up our records
+  ;; of variables visible in runtime. (This was a bug until 
+  ;; Nikodemus Siivola's patch in sbcl-0.8.5.50.)
+  (assert (= (sb-sys:sap-int (alien-sap *environ*))
+             (sb-sys:sap-int (alien-sap environ))))
   (define-alien-routine summish int (x int) (y int))
   (assert (= (summish 10 20) 31))
   (sb-ext:quit :unix-status 52) ; success convention for Lisp program
index a5955b3..db5dba6 100644 (file)
@@ -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.5.49"
+"0.8.5.50"