0xMiden / 0xMiden/compiler

Check each MASM procedure before writing its HIR body

未關閉
#1,304 0 則留言 0 個 reaction 已指派 1 人 已被 @huitseeker 認領 在 GitHub 檢視
design frontend
主要語言
Rust
星號
115
分支
84
平均合併
1 天 8 小時
30 天內合併 PR
15

描述

## Parent

[0xMiden/compiler#1209](https://github.com/0xMiden/compiler/issues/1209)

## What to build

Lint mode checks known limits before it lifts a procedure. These checks do not cover every rule in `ProcedureLifter`. For example, an invalid local index can pass the checks and fail later in `ModuleRegistry::lift_bodies`. That error stops the whole lint run.

Split lifting into two steps. First, prepare a procedure without changing HIR. This step checks every rule used by the lifter and returns a checked procedure or an error. Then emit HIR from the checked procedure.

In lint mode, prepare all procedures first. Record each failure, skip callers that depend on a failed procedure, then declare and emit only the remaining procedures. Strict mode still returns the first error. The emit step must use the checked form. It must not repeat a separate set of checks.

This gap was found in [compiler PR #1263](https://github.com/0xMiden/compiler/pull/1263#discussion_r3694252804).

## Acceptance criteria

- [ ] An invalid local index becomes a skipped procedure in lint mode.
- [ ] A procedure with valid instructions before an invalid instruction is skipped without leaving HIR behind.
- [ ] Callers of either failed procedure are skipped with the failed callee in the reason.
- [ ] Unrelated procedures still appear in the returned HIR world.
- [ ] No HIR from a failed procedure remains in the world.
- [ ] Strict disassembly still returns an error for the same input.

## Blocked by

None. This can start now.

貢獻指南

開啟貢獻指南

研究方向

查看程式碼庫中的 ProcedureLifter 和 ModuleRegistry::lift_bodies。這項工作涉及將提升過程拆分為驗證所有規則的準備步驟和發射步驟。首先理解 PR #1263 中當前的錯誤流程。驗收標準列出了要測試的特定故障模式;確保 lint 模式收集錯誤而不停止,嚴格模式快速失敗。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
rust
領域
compilers
Issue 類型
重構
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。