From 1d615b38dd4152494d2f4d3520c8b1d917624a30 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Fri, 8 Dec 2023 15:03:09 -0800 Subject: [EH] Add exnref type back (#6149) At the Oct hybrid CG meeting, we decided to add back `exnref`, which was removed in 2020: https://github.com/WebAssembly/meetings/blob/main/main/2023/CG-10.md The new version of the proposal reflected in the explainer: https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md While adding support for `exnref` in the current codebase which has all GC subtype hierarchies, I noticed we might need `noexn` heap type for the bottom type of `exn`. We don't have it now so I just set it to 0xff for the moment. --- test/exception-handling.wast.fromBinary | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/exception-handling.wast.fromBinary') diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index e9cfce409..93678bc6f 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -4,6 +4,7 @@ (type $2 (func (param i64))) (type $3 (func (param i32 i64))) (type $4 (func (param eqref))) + (type $5 (func (result exnref))) (tag $e-i32 (param i32)) (tag $e-i64 (param i64)) (tag $e-i32-i64 (param i32 i64)) @@ -428,5 +429,18 @@ ) (nop) ) + (func $exnref-test (type $5) (result exnref) + (local $exn exnref) + (local $null-exn nullexnref) + (if (result exnref) + (i32.const 1) + (if (result nullexnref) + (i32.const 1) + (local.get $null-exn) + (ref.null noexn) + ) + (local.get $exn) + ) + ) ) -- cgit v1.2.3