diff options
author | Alon Zakai <azakai@google.com> | 2024-10-17 12:49:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 12:49:43 -0700 |
commit | 6566329fecd36c8cd8e2ab29f89dafde0d2e9304 (patch) | |
tree | 87e722eb17ab96e3dfe2ac865b53e6bede8bb61d /src/wasm/wasm-validator.cpp | |
parent | fd86eadb591576b82b0b564f95952b131979e91a (diff) | |
download | binaryen-6566329fecd36c8cd8e2ab29f89dafde0d2e9304.tar.gz binaryen-6566329fecd36c8cd8e2ab29f89dafde0d2e9304.tar.bz2 binaryen-6566329fecd36c8cd8e2ab29f89dafde0d2e9304.zip |
[EH][GC] Send a non-nullable exnref from TryTable (#7013)
When EH+GC are enabled then wasm has non-nullable types, and the
sent exnref should be non-nullable. In BinaryenIR we use the non-
nullable type all the time, which we also do for function references
and other things; we lower it if GC is not enabled to a nullable type
for the binary format (see `WasmBinaryWriter::writeType`, to which
comments were added in this PR). That is, this PR makes us handle
exnref the same as those other types.
A new test verifies that behavior. Various existing tests are updated
because ReFinalize will now use the more refined type, so this is
an optimization. It is also a bugfix as in #6987 we started to emit
the refined form in the fuzzer, and this PR makes us handle it
properly in validation and ReFinalization.
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index a86187fa7..0184e3284 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2658,7 +2658,7 @@ void FunctionValidator::visitTryTable(TryTable* curr) { "the number of catch tags and sent types do not match"); const char* invalidSentTypeMsg = "invalid catch sent type information"; - Type exnref = Type(HeapType::exn, Nullable); + Type exnref = Type(HeapType::exn, NonNullable); for (Index i = 0; i < curr->catchTags.size(); i++) { auto sentType = curr->sentTypes[i]; size_t tagTypeSize; |