From dougk at google.com Thu Feb 8 04:21:19 2018 From: dougk at google.com (Douglas Katzman) Date: Wed, 7 Feb 2018 23:21:19 -0500 Subject: swank sbcl patch Message-ID: Hi, 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 Thanks Doug --- 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 s)) - (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) sb-vm:word-shift) - :stream s))))))) + (sb-disassem:disassemble-code-component o :stream s))))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From luismbo at gmail.com Thu Feb 8 11:42:15 2018 From: luismbo at gmail.com (=?UTF-8?Q?Lu=C3=ADs_Oliveira?=) Date: Thu, 08 Feb 2018 11:42:15 +0000 Subject: swank sbcl patch In-Reply-To: References: Message-ID: Applied here: https://github.com/slime/slime/commit/81017fbc9e622d3f0f9fa4b35e35f9ab8c4d381b Thanks! Luís On Thu, Feb 8, 2018 at 4:22 AM Douglas Katzman wrote: > Hi, > > 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 > Thanks > Doug > > --- 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 > s)) > - (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) > sb-vm:word-shift) > - :stream s))))))) > + (sb-disassem:disassemble-code-component o :stream s))))) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: