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

Unified Diff: src/builtins.cc

Issue 971001: Use FixedArray::kMaxLength instead of incorrect FixedArray::kMaxSize. (Closed)
Patch Set: Created 10 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 | no next file » | 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 4166b7121d269c5d38091cccf1b753425f306b00..c921e1838813096cc55760bce7304b6b04ce7be7 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -752,10 +752,12 @@ BUILTIN(ArrayConcat) {
int receiver_len = Smi::cast(receiver_array->length())->value();
int arg_len = Smi::cast(arg_array->length())->value();
+ // FixedArrays lengths are limited by FixedArray::kMaxLength thus
+ // we should fit into a smi.
ASSERT(receiver_len <= (Smi::kMaxValue - arg_len));
int result_len = receiver_len + arg_len;
- if (result_len > FixedArray::kMaxSize) {
+ if (result_len > FixedArray::kMaxLength) {
return CallJsBuiltin("ArrayConcat", args);
}
if (result_len == 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698