From c75815934dce8c04cc81d0456e91461a92781645 Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Wed, 15 May 2024 22:24:17 -0500 Subject: [PATCH] Fix bug 'Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data' --- .../boost/interprocess/detail/windows_intermodule_singleton.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/interprocess/detail/windows_intermodule_singleton.hpp b/include/boost/interprocess/detail/windows_intermodule_singleton.hpp index 67ce199..5439dc9 100644 --- a/include/boost/interprocess/detail/windows_intermodule_singleton.hpp +++ b/include/boost/interprocess/detail/windows_intermodule_singleton.hpp @@ -115,7 +115,7 @@ class windows_semaphore_based_map caster.addr = m; BOOST_ASSERT((caster.addr_uint64 & boost::uint64_t(3)) == 0); max_count = boost::uint32_t(caster.addr_uint64 >> 32); - initial_count = boost::uint32_t(caster.addr_uint64); + initial_count = boost::uint32_t(caster.addr_uint64 & boost::uint64_t(0x00000000FFFFFFFF)); initial_count = initial_count/4; //Make sure top two bits are zero BOOST_ASSERT((max_count & boost::uint32_t(0xC0000000)) == 0);