diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-03-01 10:30:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 10:30:00 +0900 |
commit | 7d453930f1b211baf324b1c010924d3709ff12ba (patch) | |
tree | 43773af4e683faecd10273b78a853b46bb6376a6 /test/exception-handling.wast.fromBinary | |
parent | 0eb513d730b122f38bd6c66280c8acfe183b9b35 (diff) | |
download | binaryen-7d453930f1b211baf324b1c010924d3709ff12ba.tar.gz binaryen-7d453930f1b211baf324b1c010924d3709ff12ba.tar.bz2 binaryen-7d453930f1b211baf324b1c010924d3709ff12ba.zip |
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.
Diffstat (limited to 'test/exception-handling.wast.fromBinary')
-rw-r--r-- | test/exception-handling.wast.fromBinary | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index afb9da9ac..851ec0eb4 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -6,6 +6,7 @@ (event $event$0 (attr 0) (param i32)) (event $event$1 (attr 0) (param i64)) (event $event$2 (attr 0) (param i32 i64)) + (event $event$3 (attr 0) (param)) (func $foo (nop) ) @@ -257,6 +258,14 @@ ) (delegate 0) ) + (try $label$28 + (do + (nop) + ) + (catch $event$3 + (nop) + ) + ) ) (func $rethrow-test (try $label$3 |