From 590af8639ab4f6cfd82452b5ff2b431b470c64a5 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 26 May 2022 18:55:57 -0700 Subject: [EH] Export tags (#4691) This adds exported tags to `exports` section in wasm-emscripten-finalize metadata so Emscripten can use it. Also fixes a bug in the parser. We have only recognized the export format of ```wasm (tag $e2 (param f32)) (export "e2" (tag $e2)) ``` and ignored this format: ```wasm (tag $e1 (export "e1") (param i32)) ``` Companion patch: https://github.com/emscripten-core/emscripten/pull/17064 --- src/wasm/wasm-s-parser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 82329af66..dd92278c6 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -3668,6 +3668,7 @@ void SExpressionWasmBuilder::parseTag(Element& s, bool preParseImport) { } ex->value = tag->name; ex->kind = ExternalKind::Tag; + wasm.addExport(ex.release()); } // Parse typeuse -- cgit v1.2.3