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

Unified Diff: src/elements.cc

Issue 9808110: Check double array bounds in HasElementImpl. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 9 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-119925.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index f6a1697829eb52ea99a36df53eca5befe61bd0ad..ba77de77ce7b4b97f195f4631e6a0e2fa284b102 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -844,7 +844,8 @@ class FastDoubleElementsAccessor
JSObject* holder,
uint32_t key,
FixedDoubleArray* backing_store) {
- return !backing_store->is_the_hole(key);
+ return key < static_cast<uint32_t>(backing_store->length()) &&
+ !backing_store->is_the_hole(key);
}
};
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-119925.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698