Skip to content

Require a closing bracket for memory operands at end of input #28

Closed

Description

@LunaStev

Current evidence

Audit baseline: master 3ac33ec1, after #11. Source: assembler/src/isa/amd64/parser.rs:152.

Reproduced: a file ending immediately after mov rax, [rbx is accepted and generates an object. The parser exits its loop at EOF without recording whether ] was consumed.

Reproduction

On Linux x86_64 (Rust 1.96.0), save as repro.asm:

section .text
mov rax, [rbx

Run cargo run -- asm --amd64 repro.asm -o repro.o.

Observed exit status: 0.

Wrote 456 bytes to repro.o

Scope

Difficulty: easy.

Track completion of the memory operand and return a positioned parser error when EOF arrives first.

Completion criteria

  • The reproducer fails with a missing closing bracket diagnostic.
  • A correctly closed operand works with and without a trailing newline.
  • The regression covers the exact EOF case.

Backlog index: #12. This issue owns only the bounded work described above.

Activity

  1. added
    bug
    good first issue
    assembler
    needs testing
    priority medium
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    assemblerbuggood first issueneeds testingpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions