Skip to content

[BUG] Transpiler: Loop statement transpilation generates dead code #35

Description

@Prestgg1

Issue

The transpile_body function in crates/transpiler/src/lib.rs handles Ast::Loop by generating unreachable labels without transpiling the loop body:

Ast::Loop { body } => {
    exprstream.push_str(&format!("jmp @continue1\n@contine2\n"));
}

Note: @contine2 is a typo (should be @continue2).

Expected Behavior

Loops should be transpiled to proper SSA with:

  • Entry label
  • Body transpilation
  • Back-jump to entry
  • Exit label

Files

  • crates/transpiler/src/lib.rs:186-189

Labels: bug, transpiler, good first issue

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions