Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index c4026b59ec1659c024f231fca7d6a561b6c39a72..42b981f17fb32e0640921e200febed018f214e6a 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -362,16 +362,18 @@ class BytecodeGenerator::ControlScopeForTryFinally final |
void BytecodeGenerator::ControlScope::PerformCommand(Command command, |
Statement* statement) { |
ControlScope* current = this; |
- ContextScope* context = this->context(); |
+ ContextScope* context = generator()->execution_context(); |
do { |
- if (current->Execute(command, statement)) { return; } |
- current = current->outer(); |
if (current->context() != context) { |
// Pop context to the expected depth. |
// TODO(rmcilroy): Only emit a single context pop. |
generator()->builder()->PopContext(current->context()->reg()); |
context = current->context(); |
} |
+ if (current->Execute(command, statement)) { |
+ return; |
+ } |
+ current = current->outer(); |
} while (current != nullptr); |
UNREACHABLE(); |
} |