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

Unified Diff: src/runtime/runtime-object.cc

Issue 1259853002: Cross-script variables handling fixed. It was possible to write to read-only global variable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/objects.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index ebaf006a4ffe748a5f86803acd8bfe854aca9f6c..ee607259b903e34fe303c18de7d2abedec4f489d 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -467,7 +467,7 @@ Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Name> name,
LookupIterator it(global_object, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
// a hidden prototype.
- if (LookupIterator::DATA == it.state() &&
+ if (LookupIterator::DATA == it.state() && !it.IsReadOnly() &&
it.GetHolder<Object>()->IsJSGlobalObject()) {
// Now update cell in the script context.
Handle<PropertyCell> cell = it.GetPropertyCell();
« no previous file with comments | « src/objects.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698