Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index 92223e87a0e4b9cf232512740c1d4a6f239f807e..9cd32b1c001d3b952a2cad45d52c84508ad3bf08 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -713,6 +713,12 @@ void InstructionSelector::VisitBlock(BasicBlock* block) { |
SetEffectLevel(node, effect_level); |
} |
+ // We visit the control first, then the nodes in the block, so the block's |
+ // control input should be on the same effect level as the last node. |
+ if (block->control_input() != nullptr) { |
+ SetEffectLevel(block->control_input(), effect_level); |
+ } |
+ |
// Generate code for the block control "top down", but schedule the code |
// "bottom up". |
VisitControl(block); |