mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
AK: Use TypedTransfer in Span::overwrite()
Using `__builtin_memmove` was unsafe if items in source buffer are not trivially copyable.
This commit is contained in:
parent
005551b530
commit
cd9e491742
|
|
@ -187,7 +187,7 @@ public:
|
|||
{
|
||||
// make sure we're not told to write past the end
|
||||
VERIFY(offset + data_size <= size() * sizeof(T));
|
||||
__builtin_memmove(this->data() + offset, data, data_size);
|
||||
TypedTransfer<T>::copy(this->data() + offset, static_cast<T const*>(data), data_size / sizeof(T));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE constexpr size_t copy_to(Span<RemoveConst<T>> other) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user