summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 84834352b..db253fa6e 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -6080,10 +6080,12 @@ void WasmBinaryBuilder::visitTryOrTryInBlock(Expression*& out) {
// blocks instead.
curr->type = getType();
curr->body = getBlockOrSingleton(curr->type);
- if (lastSeparator != BinaryConsts::Catch &&
- lastSeparator != BinaryConsts::CatchAll &&
- lastSeparator != BinaryConsts::Delegate) {
- throwError("No catch instruction within a try scope");
+
+ // try without catch or delegate
+ if (lastSeparator == BinaryConsts::End) {
+ curr->finalize();
+ out = curr;
+ return;
}
Builder builder(wasm);
@@ -6200,7 +6202,7 @@ void WasmBinaryBuilder::visitTryOrTryInBlock(Expression*& out) {
// (catch $e
// (block ;; Now this can be deleted when writing binary
// ...
- // (br $label0)
+ // (br $label)
// )
// )
// )