diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 0245fc01e..4150af5b4 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -933,7 +933,11 @@ static void populateTryTableSentTypes(TryTable* curr, Module* wasm) { return; } curr->sentTypes.clear(); - Type exnref = Type(HeapType::exn, Nullable); + // We always use the refined non-nullable type in our IR, which is what the + // wasm spec defines when GC is enabled (=== non-nullable types are allowed). + // If GC is not enabled then we emit a nullable type in the binary format in + // WasmBinaryWriter::writeType. + Type exnref = Type(HeapType::exn, NonNullable); for (Index i = 0; i < curr->catchTags.size(); i++) { auto tagName = curr->catchTags[i]; std::vector<Type> sentType; |