Clarify behavior for empty begin/while/repeat blocks in MASM (tests still ignored)
- 主要语言
- Rust
- 星标
- 772
- 派生
- 352
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 84
描述
## Summary
There are still ignored tests for empty `begin end`, `while.true end`, and `repeat.N end` blocks, which suggests the intended behavior is unclear or not enforced. This leaves ambiguity for compiler/codegen output and users.
## Background
Historically, empty blocks were discussed and partially addressed:
- https://github.com/0xMiden/miden-vm/issues/585
- https://github.com/0xMiden/miden-vm/pull/609
- https://github.com/0xMiden/miden-vm/pull/1360
Despite that, empty `begin/while/repeat` appear to still be unresolved (tests remain ignored).
## Why this matters
- Code generators often emit empty blocks during optimization or transformation passes.
- Without a defined behavior, identical programs can be rejected or behave inconsistently across versions.
- It is unclear whether this should be allowed as a no-op or rejected with a structured diagnostic.
## Proposed resolution
Please confirm which behavior is desired:
Option A: Reject
- Emit a structured diagnostic for empty blocks.
- Enable the ignored tests and assert the diagnostics.
Option B: Allow
- Treat empty blocks as a no-op (e.g., a canonicalized `nop`).
- Enable tests to assert the resulting output/IR.
- Document the behavior in the assembly docs.
I’m happy to take this on once the intended behavior is confirmed.
贡献指南
调研方向
Find the ignored tests for empty begin/while/repeat blocks. Look at the PRs #609 and #1360 to understand the history. Examine the assembly parser and codegen to see how these blocks are currently handled. Determine if the fix is to add a diagnostic or to treat them as a no-op, then update the tests accordingly.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100