summaryrefslogtreecommitdiff
path: root/src/wasm-traversal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-traversal.h')
-rw-r--r--src/wasm-traversal.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index 2b495e025..5a2debcdf 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -957,17 +957,20 @@ struct ControlFlowWalker : public PostWalker<SubType, VisitorType> {
while (1) {
auto* curr = controlFlowStack[i];
if (Block* block = curr->template dynCast<Block>()) {
- if (name == block->name)
+ if (name == block->name) {
return curr;
+ }
} else if (Loop* loop = curr->template dynCast<Loop>()) {
- if (name == loop->name)
+ if (name == loop->name) {
return curr;
+ }
} else {
// an if, ignorable
assert(curr->template is<If>());
}
- if (i == 0)
+ if (i == 0) {
return nullptr;
+ }
i--;
}
}
@@ -1024,23 +1027,27 @@ struct ExpressionStackWalker : public PostWalker<SubType, VisitorType> {
while (1) {
auto* curr = expressionStack[i];
if (Block* block = curr->template dynCast<Block>()) {
- if (name == block->name)
+ if (name == block->name) {
return curr;
+ }
} else if (Loop* loop = curr->template dynCast<Loop>()) {
- if (name == loop->name)
+ if (name == loop->name) {
return curr;
+ }
} else {
WASM_UNREACHABLE();
}
- if (i == 0)
+ if (i == 0) {
return nullptr;
+ }
i--;
}
}
Expression* getParent() {
- if (expressionStack.size() == 1)
+ if (expressionStack.size() == 1) {
return nullptr;
+ }
assert(expressionStack.size() >= 2);
return expressionStack[expressionStack.size() - 2];
}