Skip to content

fix disasm aborts on an attribute path of 11 or more segments #37

Description

@wyattgill9

An attribute path of 11 or more segments aborts the whole disassembly.

$ fix disasm --no-pager -E 'a: a ? b.c.d.e.f.g.h.i.j.k.l'
error: disassembly line too long
$ echo $?
1

$ fix disasm --no-pager -E 'a: a.b.c.d.e.f.g.h.i.j.k.l or 1'
error: disassembly line too long

Ten segments is fine, eleven is not. Plain select without or is not affected — a: a.b.c.d.e.f.g.h.i.j.k.l disassembles cleanly — so it is the operand lines that carry a per-segment token each.

src/expr/tooling/bytecode/disasm.zig:656:

const Line = struct {
    toks: [24]Tok = undefined,
    ...
    overflowed: bool = false,

Overflowing that fixed array sets overflowed, and the render path turns it into error.DisassemblyLineTooLong, which propagates out and kills the command. Nothing is printed at all — not the chunks before the long line, not a truncated version of the line itself.

For a debugging tool, degrading to a truncated line with an ellipsis seems better than refusing to disassemble the program.


fix 0.3.0 at 1f1a99cf, built -Doptimize=ReleaseSafe with Zig 0.16.0, darwin/aarch64. Reference implementation is Nix 2.34.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions