Ticket #13481: boost_strict_aliasing_fix.patch

File boost_strict_aliasing_fix.patch, 1013 bytes (added by Joakim Tosteberg <joakim.tosteberg@…>, 5 years ago)

Patch to fix the issue based on suggestion in original description

  • boost/function/function_template.hpp

    a b namespace boost {  
    895895      if (!f.empty()) {
    896896        this->vtable = f.vtable;
    897897        if (this->has_trivial_copy_and_destroy())
    898           this->functor = f.functor;
     898          std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));
    899899        else
    900900          get_vtable()->base.manager(f.functor, this->functor,
    901901                                     boost::detail::function::clone_functor_tag);
    namespace boost {  
    983983        if (!f.empty()) {
    984984          this->vtable = f.vtable;
    985985          if (this->has_trivial_copy_and_destroy())
    986             this->functor = f.functor;
     986            std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer));
    987987          else
    988988            get_vtable()->base.manager(f.functor, this->functor,
    989989                                     boost::detail::function::move_functor_tag);