From f5d8d30171e53c225fc640e6db8aa42973c8804c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 8 Feb 2024 15:27:02 -0800 Subject: Update lit tests to parse with the new parser (#6290) Get as many of the lit tests as possible to parse with the new parser, mostly by moving declared module items to be after imports. Also fix a bug in the new parser's pop validation to allow supertypes of the expected type. The two big issues that still prevent some lit tests from working correctly under the new parser are missing support for symbolic field names and missing support for source map annotations. --- src/wasm/wasm-ir-builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wasm/wasm-ir-builder.cpp') diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index bf3c38c1e..dadda0f25 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -1323,7 +1323,7 @@ Result<> IRBuilder::makePop(Type type) { "pop instructions may only appear at the beginning of catch blocks"}; } auto expectedType = scope.exprStack[0]->type; - if (type != expectedType) { + if (!Type::isSubType(expectedType, type)) { return Err{std::string("Expected pop of type ") + expectedType.toString()}; } return Ok{}; -- cgit v1.2.3