From 4d089648bedf439f5bdadfcea208f79e6e3d9421 Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 12 Sep 2018 19:09:07 -0500 Subject: [PATCH] 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 --- js/public/Utility.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/public/Utility.h b/js/public/Utility.h index 68de3004ab..99712faa8b 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -391,7 +391,7 @@ js_delete_poison(const T* p) { if (p) { p->~T(); - memset(const_cast(p), 0x3B, sizeof(T)); + memset(static_cast(const_cast(p)), 0x3B, sizeof(T)); js_free(const_cast(p)); } }