From b48e4de5ea13434ded315b2bc99a713db0361f63 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 7 Nov 2022 12:45:01 -0800 Subject: 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. --- src/wasm/wat-parser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/wasm/wat-parser.cpp') diff --git a/src/wasm/wat-parser.cpp b/src/wasm/wat-parser.cpp index 1c1349e47..7705c9e5c 100644 --- a/src/wasm/wat-parser.cpp +++ b/src/wasm/wat-parser.cpp @@ -1907,6 +1907,8 @@ template Result makeStructSet(Ctx&, Index); template Result makeArrayNewStatic(Ctx&, Index, bool default_); template +Result makeArrayNewSeg(Ctx&, Index, ArrayNewSegOp op); +template Result makeArrayInitStatic(Ctx&, Index); template Result makeArrayGet(Ctx&, Index, bool signed_ = false); @@ -2891,6 +2893,12 @@ makeArrayNewStatic(Ctx& ctx, Index pos, bool default_) { return ctx.in.err("unimplemented instruction"); } +template +Result +makeArrayNewSeg(Ctx& ctx, Index pos, ArrayNewSegOp op) { + return ctx.in.err("unimplemented instruction"); +} + template Result makeArrayInitStatic(Ctx& ctx, Index pos) { return ctx.in.err("unimplemented instruction"); -- cgit v1.2.3