diff options
Diffstat (limited to 'src/wasm-traversal.h')
-rw-r--r-- | src/wasm-traversal.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h index 1a458bdf7..f5f25dd1f 100644 --- a/src/wasm-traversal.h +++ b/src/wasm-traversal.h @@ -403,7 +403,8 @@ using ExpressionStack = SmallVector<Expression*, 10>; template<typename SubType, typename VisitorType = Visitor<SubType>> struct ControlFlowWalker : public PostWalker<SubType, VisitorType> { - ExpressionStack controlFlowStack; // contains blocks, loops, and ifs + // contains blocks, loops, ifs, trys, and try_tables + ExpressionStack controlFlowStack; // Uses the control flow stack to find the target of a break to a name Expression* findBreakTarget(Name name) { @@ -420,8 +421,9 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> { return curr; } } else { - // an if or try, ignorable - assert(curr->template is<If>() || curr->template is<Try>()); + // an if, try, or try_table, ignorable + assert(curr->template is<If>() || curr->template is<Try>() || + curr->template is<TryTable>()); } if (i == 0) { return nullptr; @@ -447,7 +449,8 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> { case Expression::Id::BlockId: case Expression::Id::IfId: case Expression::Id::LoopId: - case Expression::Id::TryId: { + case Expression::Id::TryId: + case Expression::Id::TryTableId: { self->pushTask(SubType::doPostVisitControlFlow, currp); break; } @@ -461,7 +464,8 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> { case Expression::Id::BlockId: case Expression::Id::IfId: case Expression::Id::LoopId: - case Expression::Id::TryId: { + case Expression::Id::TryId: + case Expression::Id::TryTableId: { self->pushTask(SubType::doPreVisitControlFlow, currp); break; } |