Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1318693002: [turbofan] Fix broken dynamic TDZ check for let and const. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-4388.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index e6acf4d157e35986d402e5f37bca597594946ae6..23305961d6bfd125fee2eb02b489f72038dc4c35 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -3505,13 +3505,10 @@ Node* AstGraphBuilder::BuildVariableAssignment(
return value;
} else if (mode == LET && op != Token::INIT_LET) {
// Perform an initialization check for let declared variables.
- // Also note that the dynamic hole-check is only done to ensure that
- // this does not break in the presence of do-expressions within the
- // temporal dead zone of a let declared variable.
Node* current = environment()->Lookup(variable);
if (current->op() == the_hole->op()) {
value = BuildThrowReferenceError(variable, bailout_id);
- } else if (value->opcode() == IrOpcode::kPhi) {
+ } else if (current->opcode() == IrOpcode::kPhi) {
value = BuildHoleCheckThenThrow(current, variable, value, bailout_id);
}
} else if (mode == CONST && op == Token::INIT_CONST) {
@@ -3527,7 +3524,7 @@ Node* AstGraphBuilder::BuildVariableAssignment(
Node* current = environment()->Lookup(variable);
if (current->op() == the_hole->op()) {
return BuildThrowReferenceError(variable, bailout_id);
- } else if (value->opcode() == IrOpcode::kPhi) {
+ } else if (current->opcode() == IrOpcode::kPhi) {
BuildHoleCheckThenThrow(current, variable, value, bailout_id);
}
return BuildThrowConstAssignError(bailout_id);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-4388.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698