bytecodealliance / bytecodealliance/regalloc2

Fuzzer Not Detecting Incorrect Allocation

オープン
#191 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
265
フォーク
53
PR マージ指標
30日以内にマージされた PR はありません

説明

It's possible for vregs to be used or defined in branch instructions, but the fuzzer doesn't seem to check for these operands.

The following doesn't pass the fuzzer:

```
block0:
0. branch(1). operands: [def v0 (fixed: p0)] // Allocation: [v0: p0]

block1:
1. operands: [use v0 (fixed: p0)] // Allocation: [v0: p0]
```

And this does:

```
block0:
0. operand: [def v0 (fixed: p0)] // Allocation: [v0: p0]
1. branch(1). operands: [use v0 (fixed: p1)] // Allocation: [v0: p9]

block1:
2. operands: [use v0 (fixed: p0)] // Allocation: [v0: p0]
```

Which is incorrect.

To reproduce this, run the tests in `src/fastalloc/tests.rs` at https://github.com/d-sonuga/regalloc2/tree/975dee0ceb56bbc6cbd21554a237babe1e388573.

To resolve this issue, one of the following could be done:

- Disallow operands in branch instructions.
- Update the fuzzer to check for these operands.

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

このリポジトリのコントリビューションガイドは索引されていません

評価

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

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

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