diff --git a/crates/wasmparser/src/binary_reader.rs b/crates/wasmparser/src/binary_reader.rs
index 8c560e64c0..b7eaddaa76 100644
--- a/crates/wasmparser/src/binary_reader.rs
+++ b/crates/wasmparser/src/binary_reader.rs
@@ -1110,7 +1110,6 @@ impl<'a> BinaryReader<'a> {
0x09 => Operator::Rethrow {
relative_depth: self.read_var_u32()?,
},
- 0x0a => Operator::Unwind,
0x0b => Operator::End,
0x0c => Operator::Br {
relative_depth: self.read_var_u32()?,
diff --git a/crates/wasmparser/src/operators_validator.rs b/crates/wasmparser/src/operators_validator.rs
index dc9230a459..6c5a79bf7e 100644
--- a/crates/wasmparser/src/operators_validator.rs
+++ b/crates/wasmparser/src/operators_validator.rs
@@ -113,7 +113,6 @@ enum FrameKind {
Try,
Catch,
CatchAll,
- Unwind,
}
impl OperatorValidator {
@@ -288,12 +287,7 @@ impl OperatorValidator {
// Read the expected type and expected height of the operand stack the
// end of the frame.
let frame = self.control.last().unwrap();
- // The end of an `unwind` should check against the empty block type.
- let ty = if frame.kind == FrameKind::Unwind {
- TypeOrFuncType::Type(Type::EmptyBlockType)
- } else {
- frame.block_type
- };
+ let ty = frame.block_type;
let height = frame.height;
// Pop all the result types, in reverse order, from the operand stack.
@@ -637,20 +631,6 @@ impl OperatorValidator {
}
self.unreachable();
}
- Operator::Unwind => {
- self.check_exceptions_enabled()?;
- // Switch from `try` to an `unwind` frame.
- let frame = self.pop_ctrl(resources)?;
- if frame.kind != FrameKind::Try {
- bail_op_err!("unwind found outside of an `try` block");
- }
- self.control.push(Frame {
- kind: FrameKind::Unwind,
- block_type: frame.block_type,
- height: self.operands.len(),
- unreachable: false,
- });
- }
Operator::Delegate { relative_depth } => {
self.check_exceptions_enabled()?;
let frame = self.pop_ctrl(resources)?;
diff --git a/crates/wasmparser/src/primitives.rs b/crates/wasmparser/src/primitives.rs
index 1fac17db12..dc7657beb3 100644
--- a/crates/wasmparser/src/primitives.rs
+++ b/crates/wasmparser/src/primitives.rs
@@ -365,7 +365,6 @@ pub enum Operator<'a> {
Rethrow {
relative_depth: u32,
},
- Unwind,
End,
Br {
relative_depth: u32,
diff --git a/crates/wasmprinter/src/lib.rs b/crates/wasmprinter/src/lib.rs
index b4b3f5ecab..4bfa35f980 100644
--- a/crates/wasmprinter/src/lib.rs
+++ b/crates/wasmprinter/src/lib.rs
@@ -683,8 +683,7 @@ impl Printer {
// our nesting level.
Operator::Else
| Operator::Catch { .. }
- | Operator::CatchAll
- | Operator::Unwind => {
+ | Operator::CatchAll => {
self.nesting -= 1;
self.newline();
self.nesting += 1;
@@ -762,7 +761,6 @@ impl Printer {
label(*relative_depth)
)?;
}
- Unwind => self.result.push_str("unwind"),
End => self.result.push_str("end"),
Br { relative_depth } => {
write!(
diff --git a/crates/wast/src/ast/expr.rs b/crates/wast/src/ast/expr.rs
index 5cfbd04961..6caf840d98 100644
--- a/crates/wast/src/ast/expr.rs
+++ b/crates/wast/src/ast/expr.rs
@@ -84,8 +84,8 @@ enum If<'a> {
enum Try<'a> {
/// Next thing to parse is the `do` block.
Do(Instruction<'a>),
- /// Next thing to parse is `catch`/`catch_all`, `unwind`, or `delegate`.
- CatchUnwindOrDelegate,
+ /// Next thing to parse is `catch`/`catch_all`, or `delegate`.
+ CatchOrDelegate,
/// Next thing to parse is a `catch` block or `catch_all`.
Catch,
/// Finished parsing like the `End` case, but does not push `end` opcode.
@@ -199,9 +199,9 @@ impl<'a> ExpressionParser<'a> {
Level::Try(Try::Do(_)) => {
return Err(parser.error("previous `try` had no `do`"));
}
- Level::Try(Try::CatchUnwindOrDelegate) => {
+ Level::Try(Try::CatchOrDelegate) => {
return Err(parser.error(
- "previous `try` had no `catch`, `catch_all`, `unwind`, or `delegate`",
+ "previous `try` had no `catch`, `catch_all`, or `delegate`",
));
}
Level::Try(Try::Delegate) => {}
@@ -335,7 +335,7 @@ impl<'a> ExpressionParser<'a> {
if parser.parse::