Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 963912f66a9a74dc73ad74b8af32efabf514cccb..4dd92e8cdff03dbe70c33d6e9030862f6da92dc1 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -607,6 +607,11 @@ MemOperand FullCodeGenerator::StackOperand(Variable* var) { |
offset += (info_->scope()->num_parameters() + 1) * kPointerSize; |
} else { |
offset += JavaScriptFrameConstants::kLocal0Offset; |
+ // Test if the variable is from a nested block scope. |
+ if (info_->scope() != var->scope()) { |
+ // Skip handlers and stack locals from enclosing block scopes. |
+ offset -= var->scope()->stack_slots_depth() * kPointerSize; |
+ } |
} |
return Operand(rbp, offset); |
} |