Call memset on a void*, not a T*, in js_delete_poison to avoid memset-on-nontrivial warnings with gcc that don't matter for an object whose lifetime is about to end

This commit is contained in:
trav90 2018-09-12 19:09:07 -05:00 committed by Roy Tam
commit 4d089648be

View file

@ -391,7 +391,7 @@ js_delete_poison(const T* p)
{
if (p) {
p->~T();
memset(const_cast<T*>(p), 0x3B, sizeof(T));
memset(static_cast<void*>(const_cast<T*>(p)), 0x3B, sizeof(T));
js_free(const_cast<T*>(p));
}
}