swank sbcl patch

Douglas Katzman dougk at google.com
Thu Feb 8 04:21:19 UTC 2018


Please apply this diff. There are multiple problems with the existing code.
* it seems to believe that DISASSEMBLE-CODE-COMPONENT only works on with
non-null %code-debug-info. That's not true; it works on any code object. So
depending on your standards, it's excessively wordy to just plain wrong.

* (ash (sb-kernel:%code-code-size o) sb-vm:word-shift) causes buffer overrun

* sb-disassem::align can not be called

See https://bugs.launchpad.net/sbcl/+bug/1748041

--- a/swank/sbcl.lisp
+++ b/swank/sbcl.lisp
@@ -1613,18 +1613,7 @@ stack."
          append (label-value-line i (sb-kernel:code-header-ref o i)))
    `("Code:" (:newline)
              , (with-output-to-string (s)
-                 (cond ((sb-kernel:%code-debug-info o)
-                        (sb-disassem:disassemble-code-component o :stream
-                       (t
-                        (sb-disassem:disassemble-memory
-                         (sb-disassem::align
-                          (+ (logandc2 (sb-kernel:get-lisp-obj-address o)
-                                       sb-vm:lowtag-mask)
-                             (* sb-vm:code-constants-offset
-                                sb-vm:n-word-bytes))
-                          (ash 1 sb-vm:n-lowtag-bits))
-                         (ash (sb-kernel:%code-code-size o)
-                         :stream s)))))))
+                 (sb-disassem:disassemble-code-component o :stream s)))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20180207/b9573695/attachment.html>

More information about the slime-devel mailing list