Index: src/wasm/asm-wasm-builder.cc |
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc |
index ba1f800c34afb28b7acdc6f9bed122daf30c7ed8..00f459316f6a4d69581f1ca6039ccb9b3222b386 100644 |
--- a/src/wasm/asm-wasm-builder.cc |
+++ b/src/wasm/asm-wasm-builder.cc |
@@ -110,11 +110,15 @@ class AsmWasmBuilderImpl : public AstVisitor { |
} |
} |
} |
- DCHECK(in_function_); |
- BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprBlock, false, |
- static_cast<byte>(stmt->statements()->length())); |
- RECURSE(VisitStatements(stmt->statements())); |
- DCHECK(block_size_ >= 0); |
+ if (in_function_) { |
+ BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprBlock, |
+ false, |
+ static_cast<byte>(stmt->statements()->length())); |
+ RECURSE(VisitStatements(stmt->statements())); |
+ DCHECK(block_size_ >= 0); |
+ } else { |
+ RECURSE(VisitStatements(stmt->statements())); |
+ } |
} |
class BlockVisitor { |