Skip to content
Snippets Groups Projects
Commit b9403c20 authored by dtc's avatar dtc
Browse files

o Have the print VOP allocated room on the number stack for the top

  two register args popped by call_into_c, avoiding potential stack
  corruption. Noted by Daniel Barlow.
parent 78c7697a
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/alpha/print.lisp,v 1.2 1994/10/31 04:39:51 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/alpha/print.lisp,v 1.3 2001/02/20 20:54:32 dtc Rel $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
(in-package "ALPHA") (in-package "ALPHA")
;;; Some room needs to be allocated on the number stack because call_into_c
;;; pops two register args before calling into C and restores the NSP upon
;;; return.
;;;
(define-vop (print) (define-vop (print)
(:args (object :scs (descriptor-reg) :target a0)) (:args (object :scs (descriptor-reg) :target a0))
(:results (result :scs (descriptor-reg))) (:results (result :scs (descriptor-reg)))
...@@ -34,7 +37,9 @@ ...@@ -34,7 +37,9 @@
(store-stack-tn nfp-save cur-nfp)) (store-stack-tn nfp-save cur-nfp))
(inst li (make-fixup "debug_print" :foreign) cfunc) (inst li (make-fixup "debug_print" :foreign) cfunc)
(inst li (make-fixup "call_into_c" :foreign) temp) (inst li (make-fixup "call_into_c" :foreign) temp)
(inst lda nsp-tn (- 16) nsp-tn)
(inst jsr lip-tn temp (make-fixup "call_into_c" :foreign)) (inst jsr lip-tn temp (make-fixup "call_into_c" :foreign))
(inst lda nsp-tn 16 nsp-tn)
(when cur-nfp (when cur-nfp
(maybe-load-stack-nfp-tn cur-nfp nfp-save temp)) (maybe-load-stack-nfp-tn cur-nfp nfp-save temp))
(move cfunc result)))) (move cfunc result))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment