From: Nikodemus Siivola Date: Mon, 18 Oct 2010 14:54:33 +0000 (+0000) Subject: 1.0.43.68: disassembler: remove unsafe SAP from MAKE-DSTATE X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=44571438f3fc230bcc788e304bf9dfa85f8145a3;p=sbcl.git 1.0.43.68: disassembler: remove unsafe SAP from MAKE-DSTATE (This was supposed to go in as 1.0.43.66, but somehow the actual content didn't make it...) The old code was about as sane and safe as initializing it with (INT-SAP (RANDOM-ADDRESS)). Allow DSTATE-SEGMENT-SAP to be NIL till it is properly initialized. --- diff --git a/src/compiler/disassem.lisp b/src/compiler/disassem.lisp index bc0f428..7bf98fb 100644 --- a/src/compiler/disassem.lisp +++ b/src/compiler/disassem.lisp @@ -1596,7 +1596,7 @@ ;; offset of next position (next-offs 0 :type offset) ;; a sap pointing to our segment - (segment-sap (missing-arg) :type sb!sys:system-area-pointer) + (segment-sap nil :type (or null sb!sys:system-area-pointer)) ;; the current segment (segment nil :type (or null segment)) ;; what to align to in most cases diff --git a/src/compiler/target-disassem.lisp b/src/compiler/target-disassem.lisp index 636e446..f71c8ca 100644 --- a/src/compiler/target-disassem.lisp +++ b/src/compiler/target-disassem.lisp @@ -795,10 +795,7 @@ ;;; Make a disassembler-state object. (defun make-dstate (&optional (fun-hooks *default-dstate-hooks*)) - (let ((sap - ;; FIXME: What is this for? This cannot be safe! - (sb!sys:vector-sap (coerce #() '(vector (unsigned-byte 8))))) - (alignment *disassem-inst-alignment-bytes*) + (let ((alignment *disassem-inst-alignment-bytes*) (arg-column (+ (or *disassem-opcode-column-width* 0) *disassem-location-column-width* @@ -808,8 +805,7 @@ (when (> alignment 1) (push #'alignment-hook fun-hooks)) - (%make-dstate :segment-sap sap - :fun-hooks fun-hooks + (%make-dstate :fun-hooks fun-hooks :argument-column arg-column :alignment alignment :byte-order sb!c:*backend-byte-order*))) diff --git a/version.lisp-expr b/version.lisp-expr index f38d76c..7c59ad9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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".) -"1.0.43.67" +"1.0.43.68"