Skip to content

Check returned value types in the IR verifier #44

Closed

Description

@LunaStev

Current evidence

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

Reproduced through ModuleBuilder: create an i64-returning function, emit const_bool(true), then ret(Some(value)). verify_module returns Ok(()). The verifier compares the terminator annotation with the function signature but never compares the actual value type.

Scope

Difficulty: easy.

Validate the returned ValueId type, including void/nonvoid consistency. Keep general instruction typing in a separate issue.

Completion criteria

  • A bool value cannot satisfy an i64 return.
  • Void returns cannot carry a value; nonvoid returns require one.
  • Missing value-type metadata is diagnosed.
  • Add small positive and negative verifier unit tests.

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