1.0.4.64: more stack-alignment x86/Darwin
[sbcl.git] / src / compiler / x86 / c-call.lisp
index df61c5c..27ebe1e 100644 (file)
                    :from :eval :to :result) ecx)
   (:temporary (:sc unsigned-reg :offset edx-offset
                    :from :eval :to :result) edx)
+  (:temporary (:sc unsigned-reg :offset esi-offset) prev-esp)
   (:node-var node)
   (:vop-var vop)
   (:save-p t)
 
            #!+darwin
            ;; Align stack for C.
-           (inst and esp-tn #xfffffff0)
+           (progn
+             (move prev-esp esp-tn)
+             (inst and esp-tn -16))
 
            (inst call function)
            ;; To give the debugger a clue. XX not really internal-error?
            (note-this-location vop :internal-error)
 
+           #!+darwin
+           ;; Restore
+           (move esp-tn prev-esp)
+
            ;; Restore the NPX for lisp; ensure no regs are empty
            (dotimes (i 7)
              (inst fldz))