This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/10081] basic_ios::_M_cache_locale leaves NULL members in the face of unknown locales


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10081


pme@gcc.gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-06-08 08:15:25         |2003-06-09 15:21:57
               date|                            |
            Summary|basic_ios constructor fails |basic_ios::_M_cache_locale
                   |to initialize variables     |leaves NULL members in the
                   |                            |face of unknown locales


------- Additional Comments From pme@gcc.gnu.org  2003-06-09 15:21 -------
Well, don't say that the members aren't being initialized, because they are:

      explicit
      basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
      : ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0)
      { this->init(__sb); }

(The names of the variables were changed mid-May.)

The crash is because _M_ctype is still NULL when op>> is executed, leading to
a NULL facet argument in __check_facet.  basic_ios::init makes an attempt to
cache the facet, but since has_facet is (I expect) false for pod_char, the
members are not assigned new values.

I don't know what the Right Thing is here.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]