Revision: 9980 Author: [email protected] Date: Fri Nov 11 09:21:16 2011 Log: Catch OOM when sparse array join results in too large array.
Review URL: http://codereview.chromium.org/8540006 http://code.google.com/p/v8/source/detail?r=9980 Modified: /branches/bleeding_edge/src/runtime.cc ======================================= --- /branches/bleeding_edge/src/runtime.cc Thu Nov 10 05:39:22 2011 +++ /branches/bleeding_edge/src/runtime.cc Fri Nov 11 09:21:16 2011 @@ -6970,7 +6970,8 @@ // 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()); -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
