diff options
author | Alon Zakai <azakai@google.com> | 2021-03-02 23:41:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 15:41:16 -0800 |
commit | 5f88277c4bddc097d2f073e41488889f02b08103 (patch) | |
tree | d669c7c77f9945f696930c3b29c7d67a21a5d274 /test/heap-types.wast.fromBinary | |
parent | e7c6356c7529c29ef06f4541bc3164659e8917f6 (diff) | |
download | binaryen-5f88277c4bddc097d2f073e41488889f02b08103.tar.gz binaryen-5f88277c4bddc097d2f073e41488889f02b08103.tar.bz2 binaryen-5f88277c4bddc097d2f073e41488889f02b08103.zip |
[Wasm GC] Allow subtyping in arguments to struct.get etc. Fixes #3636 (#3644)
Note that Binaryen "canonicalizes" the type, so in the test output here
we end up with $grandchild twice. This is a consequence of us not
storing the heap type as an extra field. I can't think of a downside to
this canonicalization, aside from losing perfect roundtripping, but I think
that's a worthwhile tradeoff for efficiency as we've been thinking so far.
Fixes #3636
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r-- | test/heap-types.wast.fromBinary | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary index 2fe6adbe1..795c789ca 100644 --- a/test/heap-types.wast.fromBinary +++ b/test/heap-types.wast.fromBinary @@ -5,6 +5,7 @@ (type $vector (array (mut f64))) (type $anyref_=>_none (func (param anyref))) (type $parent (struct )) + (type $grandchild (struct (field i32) (field i64))) (type $struct.C (struct (field $named-mut (mut f32)))) (type $none_=>_none (func)) (type $rtt_1_$parent_=>_none (func (param (rtt 1 $parent)))) @@ -12,7 +13,6 @@ (type $ref?|$struct.A|_=>_ref?|$struct.B| (func (param (ref null $struct.A)) (result (ref null $struct.B)))) (type $ref?|$vector|_=>_ref?|$matrix| (func (param (ref null $vector)) (result (ref null $matrix)))) (type $child (struct (field i32))) - (type $grandchild (struct (field i32) (field i64))) (type $words (array (mut i32))) (type $bytes (array (mut i8))) (global $rttparent (rtt 0 $parent) (rtt.canon $parent)) @@ -62,6 +62,11 @@ ) ) (drop + (struct.get $grandchild 0 + (ref.null $grandchild) + ) + ) + (drop (ref.null $struct.A) ) (drop |