From 02c33537b416f7103db02db2b85b62b56ed73781 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 29 Apr 2014 08:24:54 +0000 Subject: [PATCH] Add missing length check when copying fixed arrays. This was mistakenly removed in r21027. R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/259203002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap-inl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/heap-inl.h b/src/heap-inl.h index 4f92d08..a728777 100644 --- a/src/heap-inl.h +++ b/src/heap-inl.h @@ -161,16 +161,19 @@ MaybeObject* Heap::AllocateTwoByteInternalizedString(Vector 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()); } -- 2.7.4