Reviewers: Benedikt Meurer,

Description:
Add missing length check when copying fixed arrays.

This was mistakenly removed in r21027.
[email protected]

Please review this at https://codereview.chromium.org/259203002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+3, -0 lines):
  M src/heap-inl.h


Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 4f92d0882fc9ffbddf08d0e074e33a67c52e85d7..a728777df19b9b93d196320807fa56118d60991a 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -161,16 +161,19 @@ MaybeObject* Heap::AllocateTwoByteInternalizedString(Vector<const uc16> str,
 }

 MaybeObject* Heap::CopyFixedArray(FixedArray* src) {
+  if (src->length() == 0) return src;
   return CopyFixedArrayWithMap(src, src->map());
 }


 MaybeObject* Heap::CopyFixedDoubleArray(FixedDoubleArray* src) {
+  if (src->length() == 0) return src;
   return CopyFixedDoubleArrayWithMap(src, src->map());
 }


 MaybeObject* Heap::CopyConstantPoolArray(ConstantPoolArray* src) {
+  if (src->length() == 0) return src;
   return CopyConstantPoolArrayWithMap(src, src->map());
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to