From 235669f239a7347297bc1c24a6e0012e2505d66a Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Wed, 25 Sep 2013 23:42:34 +0400 Subject: [PATCH] Restore win32 build. The changes to special binding made binding space to contain tls-indexes instead of symbols, but on windows WITH-TLS-EA macro causes the tls-index to be an absolute address, storing which caused problems when UNBIND performed its own address resolution. Reported by Elliot Slaughter. --- src/compiler/x86/cell.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index 9483fee..8a93d7b 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -285,7 +285,8 @@ (define-vop (bind) (:args (val :scs (any-reg descriptor-reg)) (symbol :scs (descriptor-reg))) - (:temporary (:sc unsigned-reg) tls-index bsp) + (:temporary (:sc unsigned-reg) tls-index bsp + #!+win32 temp) (:generator 10 (load-binding-stack-pointer bsp) (loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag) @@ -304,10 +305,15 @@ (#.esi-offset 'alloc-tls-index-in-esi)) :assembly-routine)) TLS-INDEX-VALID + ;; with-tls-ea on win32 causes tls-index to be an absolute address + ;; which is problematic when UNBIND uses with-tls-ea too. + #!+win32(move temp tls-index) (with-tls-ea (EA :base tls-index :base-already-live-p t) (inst push EA :maybe-fs) (popw bsp (- binding-value-slot binding-size)) - (storew tls-index bsp (- binding-symbol-slot binding-size)) + (storew #!-win32 tls-index + #!+win32 temp + bsp (- binding-symbol-slot binding-size)) (inst mov EA val :maybe-fs)))) #!-sb-thread -- 1.7.10.4