Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/heap-inl.h

Issue 259203002: Add missing length check when copying fixed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698