From fc46064c29439c9025e4b228242f68f60c1ca772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 2 May 2023 22:42:29 +0200 Subject: [PATCH] Fix UB when downcasting null pointers, use pointer_trait' specialized function --- include/boost/intrusive/hashtable.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/intrusive/hashtable.hpp b/include/boost/intrusive/hashtable.hpp index 3baa465..11c81d7 100644 --- a/include/boost/intrusive/hashtable.hpp +++ b/include/boost/intrusive/hashtable.hpp @@ -591,7 +591,7 @@ inline typename pointer_traits::template rebind_pointer::typ dcast_bucket_ptr(const SlistNodePtr &p) { typedef typename pointer_traits::template rebind_pointer::type node_ptr; - return pointer_traits::pointer_to(static_cast(*p)); + return pointer_traits::static_cast_from(p); } template