Skip to content

Validate IR entry blocks and branch destinations #45

Closed

Description

@LunaStev

Current evidence

Audit baseline: master 3ac33ec1, after #11. Source: ir/src/verifier.rs:47.

Reproduced: ModuleBuilder.br(BlockId(999)) in a function with no block 999 passes verify_module. Br destinations are ignored; CBr and Switch destination existence is also unchecked.

Scope

Difficulty: easy.

Build a per-function block-ID set and validate entry, direct branch, conditional branch and switch destinations.

Completion criteria

  • Every control-flow destination and entry belongs to the same function.
  • Empty/missing-entry function bodies are rejected according to the function-definition contract.
  • Tests cover each terminator and a valid loop.

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

Activity

  1. added
    bug
    good first issue
    ir
    needs testing
    priority high
    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

    buggood first issueirneeds testingpriority high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions