Disassembly of long lambda-lists not line-wrapped correctly

Bug #1889456 reported by Wilfredo Velázquez-Rodríguez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Undecided
Unassigned

Bug Description

(let ((*print-right-margin* 30))
           (disassemble (lambda (&rest args) args)))
; disassembly for (LAMBDA
                      (
                       &REST
                       ARGS))
; Size: 29 bytes. Origin: #x228ED9B5 ; (LAMBDA
                                                                    (
                                                                     &REST
                                                                     ARGS))
; B5: 498B4510 MOV RAX, [R13+16] ; thread.binding-stack-pointer
; B9: 488945E8 MOV [RBP-24], RAX
; BD: 488BE5 MOV RSP, RBP
; C0: F8 CLC
; C1: 5D POP RBP
; C2: C3 RET
; C3: CC10 INT3 16 ; Invalid argument count trap
; C5: 4C29DF SUB RDI, R11
; C8: 57 PUSH RDI
; C9: FF14255000A021 CALL QWORD PTR [#x21A00050] ; CONS->R11
; D0: EBB1 JMP #x228ED983 ; #<FUNCTION (LAMBDA
                                                              ; ( ..))>

No ; for each line

Revision history for this message
Stas Boukarev (stassats) wrote :

That's how generic functions are implemented.

Changed in sbcl:
status: New → Invalid
Revision history for this message
Michał "phoe" Herda (phoe-krk) wrote :

This is likely a question of printing the LAMBDA in a way where it spans multiple lines, but only the first one is commented out.

; Size: 53 bytes. Origin: #x522B37F8 ; (LAMBDA
                                                                    (
                                                                     &REST
                                                                     SB-PCL::ARGS)
                                                                  :IN
                                                                  SB-PCL::MAKE-INITIAL-DFUN)

Revision history for this message
Wilfredo Velázquez-Rodríguez (zulu-inuoe) wrote :

Just to make sure there weren't any misunderstandings in case my report wasn't clear enough (it probably wasn't): I'm bringing up the fact that the lines

                                                                     &REST
                                                                     SB-PCL::ARGS)
                                                                  :IN
                                                                  SB-PCL::MAKE-INITIAL-DFUN)

Are not commented in the output unlike the rest of the disassemble output

It's certainly not standard violating, but I noticed it from a buffer configured to syntax highlight as CL and noticed those lines as not being comments.

If that's fine, all good.

Thanks!

Revision history for this message
Stas Boukarev (stassats) wrote :

Ok, the generic function part was the obscuring part. I'll rewrite the ticket.

Changed in sbcl:
status: Invalid → Confirmed
summary: - Disassembly of generic functions not comment lambda list
+ Disassembly of long lambda-lists not line-wrapped correctly
description: updated
Revision history for this message
Wilfredo Velázquez-Rodríguez (zulu-inuoe) wrote :

Thank you!

I neglected to test anonymous functions with long lambda lists. Sorry about that

doing

(disassemble (lambda (&rest args) (declare (ignore args))))

Yields an equivalent multi-line output.

Revision history for this message
Fedorov Alexander (gleefre) wrote :

Adds PPRINT-LOGICAL-BLOCK around the segment name similarly to how notes are printed in PRINT-NOTES-AND-NEWLINE.

Changed in sbcl:
status: Confirmed → Opinion
status: Opinion → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.