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

Unified Diff: src/elements.cc

Issue 1863553003: [elements] Fix length bounds precheck for Array.prototype.concat (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adding test Created 4 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
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index 3d176aef8033433615fa428fd6298533ac8bf34b..3ab770c25f26250e2b82cfadb12383f66cc88a33 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -2993,7 +2993,7 @@ Handle<JSArray> ElementsAccessor::Concat(Isolate* isolate, Arguments* args,
// We shouldn't overflow when adding another len.
const int kHalfOfMaxInt = 1 << (kBitsPerInt - 2);
- STATIC_ASSERT(FixedArray::kMaxLength < kHalfOfMaxInt);
+ STATIC_ASSERT(FixedDoubleArray::kMaxLength < kHalfOfMaxInt);
Igor Sheludko 2016/04/05 12:53:27 You could probably also hoist these checks out of
Camillo Bruni 2016/04/05 15:07:48 done
USE(kHalfOfMaxInt);
result_len += len;
DCHECK(0 <= result_len);

Powered by Google App Engine
This is Rietveld 408576698