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

Unified Diff: src/builtins.cc

Issue 1066003003: Make sure builtins preserve guarantees about empty element array prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE, fix nits. Created 5 years, 8 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 | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 5b076d13127f5c633b658b7136217eaa0af682c7..4f3c4596b66cf7944c9138bd7d54f556eb97189b 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -234,6 +234,12 @@ static inline MaybeHandle<FixedArrayBase> EnsureJSArrayWithWritableFastElements(
return MaybeHandle<FixedArrayBase>();
}
+ // Adding elements to the array prototype would break code that makes sure
+ // it has no elements. Handle that elsewhere.
+ if (array->GetIsolate()->is_initial_array_prototype(*array)) {
+ return MaybeHandle<FixedArrayBase>();
+ }
+
// Need to ensure that the arguments passed in args can be contained in
// the array.
int args_length = args->length();
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698