diff options
author | Thomas Lively <tlively@google.com> | 2022-11-07 12:45:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 12:45:01 -0800 |
commit | b48e4de5ea13434ded315b2bc99a713db0361f63 (patch) | |
tree | a1c24b6f79c624f9affb538e1daf18e67d386743 /src/wasm-delegations-fields.def | |
parent | 52079ae8ea3abec509c3184720d1824b9093cb2f (diff) | |
download | binaryen-b48e4de5ea13434ded315b2bc99a713db0361f63.tar.gz binaryen-b48e4de5ea13434ded315b2bc99a713db0361f63.tar.bz2 binaryen-b48e4de5ea13434ded315b2bc99a713db0361f63.zip |
Implement `array.new_data` and `array.new_elem` (#5214)
In order to test them, fix the binary and text parsers to accept passive data
segments even if a module has no memory. In addition to parsing and emitting the
new instructions, also implement their validation and interpretation. Test the
interpretation directly with wasm-shell tests adapted from the upstream spec
tests. Running the upstream spec tests directly would require fixing too many
bugs in the legacy text parser, so it will have to wait for the new text parser
to be ready.
Diffstat (limited to 'src/wasm-delegations-fields.def')
-rw-r--r-- | src/wasm-delegations-fields.def | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wasm-delegations-fields.def b/src/wasm-delegations-fields.def index ff0f41d50..85a088dd8 100644 --- a/src/wasm-delegations-fields.def +++ b/src/wasm-delegations-fields.def @@ -664,6 +664,15 @@ switch (DELEGATE_ID) { DELEGATE_END(ArrayNew); break; } + case Expression::Id::ArrayNewSegId: { + DELEGATE_START(ArrayNewSeg); + DELEGATE_FIELD_INT(ArrayNewSeg, op); + DELEGATE_FIELD_INT(ArrayNewSeg, segment); + DELEGATE_FIELD_CHILD(ArrayNewSeg, size); + DELEGATE_FIELD_CHILD(ArrayNewSeg, offset); + DELEGATE_END(ArrayNewSeg); + break; + } case Expression::Id::ArrayInitId: { DELEGATE_START(ArrayInit); DELEGATE_FIELD_CHILD_VECTOR(ArrayInit, values); |