Catch OOM when sparse array join results in too large array.
Review URL: http://codereview.chromium.org/8540006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
8bdb3ffbca
commit
0e47d6e417
@ -6970,7 +6970,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SparseJoinWithSeparator) {
|
||||
// Find total length of join result.
|
||||
int string_length = 0;
|
||||
bool is_ascii = separator->IsAsciiRepresentation();
|
||||
int max_string_length = SeqAsciiString::kMaxLength;
|
||||
int max_string_length = is_ascii ? SeqAsciiString::kMaxLength
|
||||
: SeqTwoByteString::kMaxLength;
|
||||
bool overflow = false;
|
||||
CONVERT_NUMBER_CHECKED(int, elements_length,
|
||||
Int32, elements_array->length());
|
||||
|
Loading…
Reference in New Issue
Block a user