Index: src/wasm/function-body-decoder.cc |
diff --git a/src/wasm/function-body-decoder.cc b/src/wasm/function-body-decoder.cc |
index 7c95b5a672300eebed09d0fe7016ddd5f06a8cdb..a798ff8c24aa17fda92c7247471acb5c3315777f 100644 |
--- a/src/wasm/function-body-decoder.cc |
+++ b/src/wasm/function-body-decoder.cc |
@@ -1241,7 +1241,15 @@ class WasmFullDecoder : public WasmDecoder { |
if (pc_ > end_ && ok()) error("Beyond end of code"); |
} |
- void EndControl() { ssa_env_->Kill(SsaEnv::kControlEnd); } |
+ void EndControl() { |
+ ssa_env_->Kill(SsaEnv::kControlEnd); |
+ if (control_.empty()) { |
rossberg
2017/01/19 12:55:11
I suppose you could avoid spurious case distinctio
|
+ stack_.clear(); |
+ } else { |
+ DCHECK_LE(control_.back().stack_depth, stack_.size()); |
+ stack_.resize(control_.back().stack_depth); |
+ } |
+ } |
void SetBlockType(Control* c, BlockTypeOperand& operand) { |
c->merge.arity = operand.arity; |