diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index c0cbe0b2ba..ce160e32a3 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -214,7 +214,7 @@ public: { // make sure we're not told to write past the end VERIFY(offset + data_size <= size()); - __builtin_memcpy(this->data() + offset, data, data_size); + __builtin_memmove(this->data() + offset, data, data_size); } void zero_fill() diff --git a/AK/Span.h b/AK/Span.h index 2de4af8da5..93e48bf911 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -144,7 +144,7 @@ public: { // make sure we're not told to write past the end VERIFY(offset + data_size <= size()); - __builtin_memcpy(this->data() + offset, data, data_size); + __builtin_memmove(this->data() + offset, data, data_size); } ALWAYS_INLINE constexpr size_t copy_to(Span> other) const