bytecodealliance / bytecodealliance/regalloc2

Fuzzer Not Detecting Incorrect Allocation

未关闭
#191 3 条评论 0 个 reaction 已指派 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 摘要。