diff options
author | Thomas Lively <tlively@google.com> | 2023-11-15 01:48:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 01:48:29 +0100 |
commit | 1496f97d7919960ef4e3f74a961d959bfc236218 (patch) | |
tree | ed65de5e925a132bc903a7102d43a038cac5f85d /src/parser/parsers.h | |
parent | 89fd9c82df5e979f04b7af68f456fd0235ee3aa9 (diff) | |
download | binaryen-1496f97d7919960ef4e3f74a961d959bfc236218.tar.gz binaryen-1496f97d7919960ef4e3f74a961d959bfc236218.tar.bz2 binaryen-1496f97d7919960ef4e3f74a961d959bfc236218.zip |
[Parser] Parse array.new_fixed (#6102)
Diffstat (limited to 'src/parser/parsers.h')
-rw-r--r-- | src/parser/parsers.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parser/parsers.h b/src/parser/parsers.h index 610e2953a..2d90a7d27 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -1382,7 +1382,13 @@ template<typename Ctx> Result<> makeArrayNewElem(Ctx& ctx, Index pos) { } template<typename Ctx> Result<> makeArrayNewFixed(Ctx& ctx, Index pos) { - return ctx.in.err("unimplemented instruction"); + auto type = typeidx(ctx); + CHECK_ERR(type); + auto arity = ctx.in.takeU32(); + if (!arity) { + return ctx.in.err(pos, "expected array.new_fixed arity"); + } + return ctx.makeArrayNewFixed(pos, *type, *arity); } template<typename Ctx> |