Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 0295a99c3d91326d9aa1dcfd8ec2ee25cbc099fa..648e4869953bca2e38a23e64b694f75c9b52ead0 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -1679,8 +1679,8 @@ Object* Heap::AllocateConsString(String* first, String* second) { |
&& second->IsAsciiRepresentation(); |
// Make sure that an out of memory exception is thrown if the length |
- // of the new cons string is too large to fit in a Smi. |
- if (length > Smi::kMaxValue || length < -0) { |
+ // of the new cons string is too large. |
+ if (length > String::kMaxLength || length < 0) { |
Top::context()->mark_out_of_memory(); |
return Failure::OutOfMemoryException(); |
} |