0xMiden / 0xMiden/miden-vm

Unsupported @callconv forms break AST rendering round trips

オープン
#3,820 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
772
フォーク
352
平均マージ
1日 12時間
マージ済み PR(30日)
93

説明

The parser accepts unsupported forms of `@callconv` as generic attributes. If a procedure also has a protocol ABI attribute, the parser infers the component model calling convention and stores both forms in the AST.

For example:

```masm
namespace test::callconv

@account_procedure
@callconv("C", "fast")
pub proc foo() -> i1
push.1
end
```

The first parse succeeds. Calling `Module::to_string()` then produces two adjacent attributes:

```masm
@callconv("C", "fast")@callconv("component-model")
```

Parsing the rendered source fails with `conflicting attributes for procedure definition`.

The parser should validate every attribute named `callconv`, regardless of its form. It should reject unsupported forms during the first parse. We should also add a test that parses this input, renders the AST, and parses the result again.

This is related to #3658, which tracks other cases where AST output does not parse.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。