forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve element segment encoding more often
This commit fixes a small regression in reencoding from bytecodealliance#1794 where element segments subtly changed encoding by accident. This commit additionally ensures that there's a text format for all element encodings and updates printing to respect the same defaults. It should now be possible to represent all formats for element segments in the text format and have them round-trippable.
- Loading branch information
1 parent
e5132af
commit 5dddfc5
Showing
331 changed files
with
714 additions
and
628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;; RUN: print % | dump | ||
|
||
;; test that all forms of element segments can be round-tripped from | ||
;; text-to-binary. | ||
(module | ||
(table 1 1 funcref) | ||
|
||
(func $f) | ||
|
||
(elem (i32.const 0) func) ;; 0x00 | ||
(elem func) ;; 0x01 | ||
(elem (table 0) (i32.const 0) func) ;; 0x02 | ||
(elem declare func) ;; 0x03 | ||
(elem (i32.const 0) funcref) ;; 0x04 | ||
(elem funcref) ;; 0x05 | ||
(elem (table 0) (i32.const 0) funcref) ;; 0x06 | ||
(elem declare funcref) ;; 0x07 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
0x0 | 00 61 73 6d | version 1 (Module) | ||
| 01 00 00 00 | ||
0x8 | 01 04 | type section | ||
0xa | 01 | 1 count | ||
--- rec group 0 (implicit) --- | ||
0xb | 60 00 00 | [type 0] SubType { is_final: true, supertype_idx: None, composite_type: CompositeType { inner: Func(FuncType { params: [], results: [] }), shared: false } } | ||
0xe | 03 02 | func section | ||
0x10 | 01 | 1 count | ||
0x11 | 00 | [func 0] type 0 | ||
0x12 | 04 05 | table section | ||
0x14 | 01 | 1 count | ||
0x15 | 70 01 01 01 | [table 0] Table { ty: TableType { element_type: funcref, table64: false, initial: 1, maximum: Some(1), shared: false }, init: RefNull } | ||
0x19 | 09 25 | element section | ||
0x1b | 08 | 8 count | ||
0x1c | 00 | element table[None] | ||
0x1d | 41 00 | i32_const value:0 | ||
0x1f | 0b | end | ||
0x20 | 00 | 0 items [indices] | ||
0x21 | 01 00 00 | element passive, 0 items [indices] | ||
0x24 | 02 00 | element table[Some(0)] | ||
0x26 | 41 00 | i32_const value:0 | ||
0x28 | 0b | end | ||
0x29 | 00 00 | 0 items [indices] | ||
0x2b | 03 00 00 | element declared 0 items [indices] | ||
0x2e | 04 | element table[None] | ||
0x2f | 41 00 | i32_const value:0 | ||
0x31 | 0b | end | ||
0x32 | 00 | 0 items [exprs funcref] | ||
0x33 | 05 70 00 | element passive, 0 items [exprs funcref] | ||
0x36 | 06 00 | element table[Some(0)] | ||
0x38 | 41 00 | i32_const value:0 | ||
0x3a | 0b | end | ||
0x3b | 70 00 | 0 items [exprs funcref] | ||
0x3d | 07 70 00 | element declared 0 items [exprs funcref] | ||
0x40 | 0a 04 | code section | ||
0x42 | 01 | 1 count | ||
============== func 0 ==================== | ||
0x43 | 02 | size of function | ||
0x44 | 00 | 0 local blocks | ||
0x45 | 0b | end | ||
0x46 | 00 0b | custom section | ||
0x48 | 04 6e 61 6d | name: "name" | ||
| 65 | ||
0x4d | 01 04 | function name section | ||
0x4f | 01 | 1 count | ||
0x50 | 00 01 66 | Naming { index: 0, name: "f" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module $table64 | ||
(table $t0 (;0;) i64 1 1 funcref) | ||
(elem (;0;) (i64.const 0) func) | ||
(elem (;0;) (table $t0) (i64.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module | ||
(table (;0;) 0 funcref) | ||
(elem (;0;) (i32.const 0) func) | ||
(elem (;0;) (table 0) (i32.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module | ||
(table (;0;) 0 funcref) | ||
(elem (;0;) (i32.const 0) func) | ||
(elem (;0;) (table 0) (i32.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module | ||
(table (;0;) 0 funcref) | ||
(elem (;0;) (i32.const 0) func) | ||
(elem (;0;) (table 0) (i32.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module | ||
(table (;0;) 0 funcref) | ||
(elem (;0;) (i32.const 0) func) | ||
(elem (;0;) (table 0) (i32.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(module | ||
(table (;0;) 0 funcref) | ||
(elem (;0;) (i32.const 0) func) | ||
(elem (;0;) (table 0) (i32.const 0) func) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.