0.9.8.14:
[sbcl.git] / src / compiler / x86-64 / c-call.lisp
index b2e4fc3..e2cf179 100644 (file)
                    (bug "Unknown alien floating point type: ~S" type)))))
 
         ;; arg0 to FUNCALL3 (function)
-        (inst mov rdi (get-lisp-obj-address #'enter-alien-callback))
+        ;;
+        ;; Indirect the access to ENTER-ALIEN-CALLBACK through
+        ;; the symbol-value slot of SB-ALIEN::*ENTER-ALIEN-CALLBACK*
+        ;; to ensure it'll work even if the GC moves ENTER-ALIEN-CALLBACK.
+        ;; Skip any SB-THREAD TLS magic, since we don't expecte anyone
+        ;; to rebind the variable. -- JES, 2006-01-01
+        (inst mov rdi (+ nil-value (static-symbol-offset
+                                    'sb!alien::*enter-alien-callback*)))
+        (loadw rdi rdi symbol-value-slot other-pointer-lowtag)
         ;; arg0 to ENTER-ALIEN-CALLBACK (trampoline index)
         (inst mov rsi (fixnumize index))
         ;; arg1 to ENTER-ALIEN-CALLBACK (pointer to argument vector)