Re: [Boost-bugs] [Boost C++ Libraries] #8512: set member_hook access violation

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8512: set member_hook access violation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-28 22:36:48


#8512: set member_hook access violation
-------------------------------------+--------------------------------------
  Reporter: toby_toby_toby@… | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: intrusive
   Version: Boost 1.53.0 | Severity: Showstopper
Resolution: | Keywords:
-------------------------------------+--------------------------------------

Comment (by igaztanaga):

 Thanks for the report. MSVC pointer to member handling it's quite chaotic.
 Can you try the following patch?

 {{{
 #!cpp
 diff U3 C:/Data/Libs/LocalSVN/boost-
 trunk/boost/intrusive/detail/parent_from_member.hpp
 C:/Data/Libs/boost/boost/intrusive/detail/parent_from_member.hpp
 --- C:/Data/Libs/LocalSVN/boost-
 trunk/boost/intrusive/detail/parent_from_member.hpp Sat Nov 24
 09:48:40 2012
 +++ C:/Data/Libs/boost/boost/intrusive/detail/parent_from_member.hpp
 Sun Apr 28 23:53:19 2013
 @@ -37,7 +37,15 @@
        boost::int32_t offset;
     } caster;
     caster.ptr_to_member = ptr_to_member;
 - return std::ptrdiff_t(caster.offset);
 + //MSVC ABI can use up to 3 int32 to represent pointer to member data
 + //with virtual base classes, in that case we must
 + //add the size of the extra __vfptr vtable.
 + if(sizeof(caster) > sizeof(boost::int32_t)){
 + return std::ptrdiff_t(caster.offset) + sizeof(void*);
 + }
 + else{
 + return std::ptrdiff_t(caster.offset);
 + }
     //This works with gcc, msvc, ac++, ibmcpp
     #elif defined(__GNUC__) || defined(__HP_aCC) || defined(BOOST_INTEL)
 || \
           defined(__IBMCPP__) || defined(__DECCXX)

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8512#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC