summaryrefslogtreecommitdiff
path: root/src/parser/parsers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/parsers.h')
-rw-r--r--src/parser/parsers.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parser/parsers.h b/src/parser/parsers.h
index 6b6bb0aa5..e2fb3732a 100644
--- a/src/parser/parsers.h
+++ b/src/parser/parsers.h
@@ -1315,11 +1315,17 @@ template<typename Ctx> Result<> makeRefCast(Ctx& ctx, Index pos) {
}
template<typename Ctx> Result<> makeBrOnNull(Ctx& ctx, Index pos, bool onFail) {
- return ctx.in.err("unimplemented instruction");
+ auto label = labelidx(ctx);
+ CHECK_ERR(label);
+ return ctx.makeBrOn(pos, *label, onFail ? BrOnNonNull : BrOnNull);
}
template<typename Ctx> Result<> makeBrOnCast(Ctx& ctx, Index pos, bool onFail) {
- return ctx.in.err("unimplemented instruction");
+ auto label = labelidx(ctx);
+ CHECK_ERR(label);
+ auto type = reftype(ctx);
+ CHECK_ERR(type);
+ return ctx.makeBrOn(pos, *label, onFail ? BrOnCastFail : BrOnCast, *type);
}
template<typename Ctx>