From 9361edfcd83310b2eac6ceca08db0d44ad22aa52 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 30 Jan 2024 06:24:39 -0800 Subject: [Parser] Parse pops (by doing nothing) (#6252) Parse pop expressions and check that they have the expected types, but do not actually create new Pop expressions or push anything onto the stack because we already create Pop expressions as necessary when visiting the beginning of catch blocks. Unlike the legacy text parser, the new text parser is not capable of parsing pops in invalid locations in the IR. This means that the new text parser will never be able to parse test/lit/catch-pop-fixup-eh-old.wast, which deliberately parses invalid IR to check that the pops can be fixed up and moved to the correct locations. It should be acceptable to delete that test when we turn on the new parser by default, though, so that won't be a problem. --- src/parser/parsers.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/parser/parsers.h') diff --git a/src/parser/parsers.h b/src/parser/parsers.h index 706c6525e..c7b9168b1 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -1555,7 +1555,9 @@ template Result<> makeMemoryFill(Ctx& ctx, Index pos) { } template Result<> makePop(Ctx& ctx, Index pos) { - return ctx.in.err("unimplemented instruction"); + auto type = valtype(ctx); + CHECK_ERR(type); + return ctx.makePop(pos, *type); } template Result<> makeCall(Ctx& ctx, Index pos, bool isReturn) { -- cgit v1.2.3