From 036a632a24679062e7fc891e7743195139bfa0a9 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 9 Feb 2021 12:12:01 -0800 Subject: Update exception handling support to current proposal (#1596) This PR updates the support of exception handling to the latest proposal (that is compatible with future 2-phase exception handling) described in https://github.com/WebAssembly/exception-handling/pull/137 and https://github.com/WebAssembly/exception-handling/pull/143. * Adds back tagged `catch $e`, `catch_all`, and `rethrow N` from a previous version of wabt, but with updates to match the current spec (e.g., `catch_all` shares an opcode with `else`, `rethrow`'s depth indexes only catch blocks, etc). * Adds `unwind` and `delegate` instructions. * Removes `exnref` and `br_on_exn`. * Updates relevant tests. There are some details that could still change (e.g., maybe how `delegate`'s depth is validated), but I'd be happy to submit further PRs if the spec details change. --- src/interp/istream.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/interp/istream.cc') diff --git a/src/interp/istream.cc b/src/interp/istream.cc index e4693c11..6c531a88 100644 --- a/src/interp/istream.cc +++ b/src/interp/istream.cc @@ -692,8 +692,8 @@ Instr Istream::Read(Offset* offset) const { break; case Opcode::Block: - case Opcode::BrOnExn: case Opcode::Catch: + case Opcode::Delegate: case Opcode::Else: case Opcode::End: case Opcode::If: @@ -703,6 +703,7 @@ Instr Istream::Read(Offset* offset) const { case Opcode::Rethrow: case Opcode::Throw: case Opcode::Try: + case Opcode::Unwind: case Opcode::ReturnCall: // Not used. break; -- cgit v1.2.3