Add an assert to ensure we never allocate second empty fixed array.
authorvitalyr@chromium.org <vitalyr@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 23 Sep 2010 12:49:59 +0000 (12:49 +0000)
committervitalyr@chromium.org <vitalyr@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 23 Sep 2010 12:49:59 +0000 (12:49 +0000)
Review URL: http://codereview.chromium.org/3442012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5514 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap.cc

index 25d199b..6d46740 100644 (file)
@@ -3195,6 +3195,7 @@ Object* Heap::AllocateRawFixedArray(int length) {
   if (length < 0 || length > FixedArray::kMaxLength) {
     return Failure::OutOfMemoryException();
   }
+  ASSERT(length > 0);
   // Use the general function if we're forced to always allocate.
   if (always_allocate()) return AllocateFixedArray(length, TENURED);
   // Allocate the raw data for a fixed array.