bytecodealliance / bytecodealliance/wasm-tools

components: Expanded aliases should be deduplicated

Open
#630 5 comments 0 reactions 0 assignees View on GitHub
component-model wast
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

Currently this component:

```wasm
(component
(core module $m
(global (export "f") i32 i32.const 0)
)
(core instance $m (instantiate $m))
(core instance
(export "a" (global $m "f"))
(export "b" (global $m "f"))
)
)
```

dumps as:

```wasm
$ cargo run -q dump foo.wat
...
0x32 | 03 0b | core alias section
0x34 | 02 | 2 count
0x35 | 03 00 00 01 | core alias [global 0] InstanceExport { kind: Global, instance_index: 0, name: "f" }
| 66
0x3a | 03 00 00 01 | core alias [global 1] InstanceExport { kind: Global, instance_index: 0, name: "f" }
| 66
...
```

This should ideally only create one core alias annotation instead of two, recognizing that the alias was already added.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.