Re: [Boost-bugs] [Boost C++ Libraries] #7435: Crash with format using UTF16 strings on MacOS X

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7435: Crash with format using UTF16 strings on MacOS X
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-22 15:51:45


#7435: Crash with format using UTF16 strings on MacOS X
--------------------------------------------------------------+-------------
  Reporter: Franz Detro <franz.detro@…> | Owner: samuel_krempp
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: format
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------------------------------+-------------

Comment (by jofaber):

 At the tagged code line, the program crashes. I does not crash, if
 `os.imbue(*loc_default);` is called before.

 {{{#!c++
 boost/format/internals.hpp(104):
     template<class Ch, class Tr>
     void stream_format_state<Ch,Tr>:: apply_on (basic_ios & os,
                       boost::io::detail::locale_t * loc_default) const {
         // set the state of this stream according to our params
         if(width_ != -1)
             os.width(width_);
         if(precision_ != -1)
             os.precision(precision_);
         if(fill_ != 0)
             os.fill(fill_); //<== crashes here
         os.flags(flags_);
         os.clear(rdstate_);
         os.exceptions(exceptions_);
 #if !defined(BOOST_NO_STD_LOCALE)
         if(loc_)
             os.imbue(loc_.get());
         else if(loc_default)
             os.imbue(*loc_default);
 #else
         (void) loc_default; // keep compiler quiet if we don't support
 locales
 #endif
     }

 }}}

 So we only need to move the bottom code (between `#if and #end` to the
 beginning of the function.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7435#comment:3>
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