From 58a8e2f0b98810198175ea6dea2945b8c67f9dad Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Fri, 12 Dec 2025 18:52:51 +0800 Subject: [PATCH] [test] Add test for catching same tag with different handlers --- test/core/exceptions/try_table.wast | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/core/exceptions/try_table.wast b/test/core/exceptions/try_table.wast index f8405210cb..5072a87184 100644 --- a/test/core/exceptions/try_table.wast +++ b/test/core/exceptions/try_table.wast @@ -253,6 +253,18 @@ (func (export "try-with-param") (i32.const 0) (try_table (param i32) (drop)) ) + + (func (export "duplicated-catches") (result i32) + (block + (block + (try_table (catch $e0 0) (catch $e0 1) + (throw $e0) + ) + ) + (return (i32.const 2)) + ) + (return (i32.const 3)) + ) ) (assert_return (invoke "simple-throw-catch" (i32.const 0)) (i32.const 23)) @@ -312,6 +324,8 @@ (assert_return (invoke "try-with-param")) +(assert_return (invoke "duplicated-catches") (i32.const 2)) + (module (func $imported-throw (import "test" "throw")) (tag $e0)