Commit 126b4f7
authored
[wasm-dis] Restore features section in output (WebAssembly#7840)
This effectively restores pre-WebAssembly#7802 status, except for the case the
input binary has the features section. If the binary does not have it,
we restore the default features (mutable-global + sign-ext) + whatever
is given in the command line before the printing. If the binary has the
features section, we just restore it before the printing.
This currently does not handle the case when there is the features
section and the user gives more features flags in the command line, but
in the current interface it is cumbersome to handle. And we were not
handling that anyway pre-WebAssembly#7802, so it is not a regression.
And we preserve the `FeaturesSet::All` setting at parsing time so
@tlively's
[concern](WebAssembly#7836 (comment))
will not be an issue.
Because we preserve the features section, WebAssembly#7836 will be addressed too.
The main motivation for WebAssembly#7802 was `call_indirect` could be incorrectly
printed, and that was also separately addressed by WebAssembly#7843.
`ModuleReader::getFeaturesSectionFeatures` was adopted from @tlively's
commit:
WebAssembly@ed36a8c
Because we don't set the features to `Features::All` at the printing
time, `(type $..)` in `(func)` definitions and `(table ..)` in
`call_indirect`s have been removed.
Fixes WebAssembly#7836.1 parent 969bf76 commit 126b4f7
File tree
38 files changed
+160
-140
lines changed- src
- tools
- wasm
- test
- lit
- merge
- metadce
- wasm-dis
- wasm-split
- reduce
38 files changed
+160
-140
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
1730 | 1731 | | |
1731 | 1732 | | |
1732 | 1733 | | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
1733 | 1737 | | |
1734 | 1738 | | |
1735 | 1739 | | |
1736 | 1740 | | |
1737 | 1741 | | |
1738 | 1742 | | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
1739 | 1747 | | |
1740 | 1748 | | |
1741 | 1749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5262 | 5262 | | |
5263 | 5263 | | |
5264 | 5264 | | |
5265 | | - | |
| 5265 | + | |
5266 | 5266 | | |
5267 | 5267 | | |
5268 | 5268 | | |
5269 | 5269 | | |
5270 | 5270 | | |
| 5271 | + | |
| 5272 | + | |
5271 | 5273 | | |
5272 | 5274 | | |
5273 | 5275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments