Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/c-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4187,7 +4187,9 @@ void CWriter::Write(const ExprList& exprs) {
Write("wasm_rt_load_exception(", ex, "_tag, ", ex, "_size, ", ex, ");",
Newline());
WriteThrow();
} break;
// Stop processing this ExprList, since the following are unreachable.
return;
}

case ExprType::Try: {
const TryExpr& tryexpr = *cast<TryExpr>(&expr);
Expand Down
15 changes: 15 additions & 0 deletions test/wasm2c/unreachable-after-rethrow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
;;; TOOL: run-spec-wasm2c
;;; ARGS*: --enable-exceptions
(module
(memory 1)
(func (export "test")
try
nop
catch_all
rethrow 0
i32.store
end))
(assert_return (invoke "test"))
(;; STDOUT ;;;
1/1 tests passed.
;;; STDOUT ;;)
Loading