summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-stack.h6
-rw-r--r--src/wasm-traversal.h6
-rw-r--r--src/wasm/wasm-stack.cpp3
3 files changed, 8 insertions, 7 deletions
diff --git a/src/wasm-stack.h b/src/wasm-stack.h
index 91c0c5383..5f0bf12af 100644
--- a/src/wasm-stack.h
+++ b/src/wasm-stack.h
@@ -779,14 +779,12 @@ void BinaryenIRWriter<SubType>::visitDrop(Drop* curr) {
template<typename SubType>
void BinaryenIRWriter<SubType>::visitPush(Push* curr) {
- // Turns into nothing in the binary format: leave the child on the stack for
- // others to use.
visit(curr->value);
+ emit(curr);
}
template<typename SubType> void BinaryenIRWriter<SubType>::visitPop(Pop* curr) {
- // Turns into nothing in the binary format: just get a value that is already
- // on the stack.
+ emit(curr);
}
// Binaryen IR to binary writer
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index c9290cbab..eae4634b5 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -1185,7 +1185,8 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> {
switch (curr->_id) {
case Expression::Id::BlockId:
case Expression::Id::IfId:
- case Expression::Id::LoopId: {
+ case Expression::Id::LoopId:
+ case Expression::Id::TryId: {
self->pushTask(SubType::doPostVisitControlFlow, currp);
break;
}
@@ -1197,7 +1198,8 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> {
switch (curr->_id) {
case Expression::Id::BlockId:
case Expression::Id::IfId:
- case Expression::Id::LoopId: {
+ case Expression::Id::LoopId:
+ case Expression::Id::TryId: {
self->pushTask(SubType::doPreVisitControlFlow, currp);
break;
}
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 22d6a0036..a308ecb7a 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1797,7 +1797,8 @@ StackInst* StackIRGenerator::makeStackInst(StackInst::Op op,
ret->op = op;
ret->origin = origin;
auto stackType = origin->type;
- if (origin->is<Block>() || origin->is<Loop>() || origin->is<If>()) {
+ if (origin->is<Block>() || origin->is<Loop>() || origin->is<If>() ||
+ origin->is<Try>()) {
if (stackType == unreachable) {
// There are no unreachable blocks, loops, or ifs. we emit extra
// unreachables to fix that up, so that they are valid as having none