From 7d453930f1b211baf324b1c010924d3709ff12ba Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Mon, 1 Mar 2021 10:30:00 +0900 Subject: Allow empty body within catch block (#3630) Previously we assumed catch body's size should be at least 3: `catch` keyword, event name, and body. But catch's body can be empty when the event's type is none. This PR fixes the bug and allows empty catch bodies to be parsed correctly. Fixes #3629. --- test/exception-handling.wast | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/exception-handling.wast') diff --git a/test/exception-handling.wast b/test/exception-handling.wast index 45cb21910..833010e73 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -2,6 +2,7 @@ (event $e-i32 (attr 0) (param i32)) (event $e-i64 (attr 0) (param i64)) (event $e-i32-i64 (attr 0) (param i32 i64)) + (event $e-empty (attr 0)) (func $foo) (func $bar) @@ -188,6 +189,12 @@ ) (delegate 0) ) + + ;; 'catch' body can be empty when the event's type is none. + (try + (do) + (catch $e-empty) + ) ) (func $rethrow-test -- cgit v1.2.3