1.0.43.68: disassembler: remove unsafe SAP from MAKE-DSTATE
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 18 Oct 2010 14:54:33 +0000 (14:54 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 18 Oct 2010 14:54:33 +0000 (14:54 +0000)
  (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.

src/compiler/disassem.lisp
src/compiler/target-disassem.lisp
version.lisp-expr

index bc0f428..7bf98fb 100644 (file)
   ;; 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
index 636e446..f71c8ca 100644 (file)
 
 ;;; 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*
     (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*)))
index f38d76c..7c59ad9 100644 (file)
@@ -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"