Commit 65a0f757 authored by Irina Yatsenko's avatar Irina Yatsenko Committed by Commit Bot

Guard against overflow in CopyImpl if requested count is zero

Bug: v8:9739
Change-Id: I6ec23018e6e2725e47efcc9a5d95dda3713d064e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803792
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63812}
parent 0999cfb4
......@@ -109,6 +109,7 @@ inline void CopyImpl(T* dst_ptr, const T* src_ptr, size_t count) {
DCHECK(((src <= dst) && ((src + count * kTWordSize) <= dst)) ||
((dst <= src) && ((dst + count * kTWordSize) <= src)));
#endif
if (count == 0) return;
// Use block copying MemCopy if the segment we're copying is
// enough to justify the extra call/setup overhead.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment