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

Unified Diff: src/elements.cc

Issue 2209273002: [elements] limit TypedElementsAccessor::IncludesValue to backing store length (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try again to make windows happy Created 4 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/es7/regress/regress-634269.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 20e358848a7938c1a13eb7d2126777847dd309e3..7a0f558cd91b26acc84b6c7fafeac379b9d29cae 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -2551,6 +2551,12 @@ class TypedElementsAccessor
return Just(false);
}
+ // Prototype has no elements, and not searching for the hole --- limit
+ // search to backing store length.
+ if (static_cast<uint32_t>(elements->length()) < length) {
+ length = elements->length();
+ }
+
if (!std::isnan(search_value)) {
for (uint32_t k = start_from; k < length; ++k) {
double element_k = elements->get_scalar(k);
« no previous file with comments | « no previous file | test/mjsunit/es7/regress/regress-634269.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698