Add check for vtable in memset template

This change makes sure the memset template is not
used with classes that contain virtual members.

Bug: b/152253831
Change-Id: I07d4777f33a9bd55c8f99d8b50a80c13df5d5805
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49648
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Jari Komppa <jari@siru.fi>
diff --git a/src/Device/Memset.hpp b/src/Device/Memset.hpp
index 877d10b..870559f 100644
--- a/src/Device/Memset.hpp
+++ b/src/Device/Memset.hpp
@@ -38,6 +38,7 @@
 	Memset(T *object, int val)
 	{
 		static_assert(std::is_base_of<Memset<T>, T>::value, "Memset<T> must only clear the memory of a type of which it is a base class");
+		static_assert(!std::is_polymorphic<T>::value, "Memset<T> must not be used with classes that have virtual functions");
 		::memset(object, 0, sizeof(T));
 	}