summaryrefslogtreecommitdiff
path: root/src/parser/parsers.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-11-15 01:48:29 +0100
committerGitHub <noreply@github.com>2023-11-15 01:48:29 +0100
commit1496f97d7919960ef4e3f74a961d959bfc236218 (patch)
treeed65de5e925a132bc903a7102d43a038cac5f85d /src/parser/parsers.h
parent89fd9c82df5e979f04b7af68f456fd0235ee3aa9 (diff)
downloadbinaryen-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.h8
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>