Skip to content
Snippets Groups Projects
Commit 72944340 authored by Rasmus Munk Larsen's avatar Rasmus Munk Larsen
Browse files

Avoid UB in ploaduSegment

parent 2265a5e0
No related branches found
No related tags found
No related merge requests found
......@@ -1566,6 +1566,7 @@ EIGEN_DEVICE_FUNC inline Packet ploaduSegment(const typename unpacket_traits<Pac
constexpr Index PacketSize = unpacket_traits<Packet>::size;
eigen_assert((begin >= 0 && count >= 0 && begin + count <= PacketSize) && "invalid range");
Scalar aux[PacketSize];
memset(static_cast<void*>(aux), 0x00, sizeof(Scalar) * PacketSize);
smart_copy(from + begin, from + begin + count, aux + begin);
return ploadu<Packet>(aux);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment