Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 46a3810c75e840f16b9039d86ab9219962e761df..3044622fa35a18265fb9dd696df6a13f7ab64fbf 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -6556,6 +6556,9 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( |
global->native_context()->script_context_table()); |
ScriptContextTable::LookupResult lookup; |
if (ScriptContextTable::Lookup(script_contexts, var->name(), &lookup)) { |
+ if (lookup.mode == CONST) { |
+ return Bailout(kNonInitializerAssignmentToConst); |
+ } |
Handle<Context> script_context = |
ScriptContextTable::GetContext(script_contexts, lookup.context_index); |
HStoreNamedField* instr = Add<HStoreNamedField>( |