[cfe-commits] [libcxx] r162571 - /libcxx/trunk/include/fstream

Howard Hinnant hhinnant at apple.com
Fri Aug 24 11:06:47 PDT 2012


Author: hhinnant
Date: Fri Aug 24 13:06:47 2012
New Revision: 162571

URL: http://llvm.org/viewvc/llvm-project?rev=162571&view=rev
Log:
Fixed order of calling use_facet vs setbuf in basic_filebuf default constructor.

Modified:
    libcxx/trunk/include/fstream

Modified: libcxx/trunk/include/fstream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/fstream?rev=162571&r1=162570&r2=162571&view=diff
==============================================================================
--- libcxx/trunk/include/fstream (original)
+++ libcxx/trunk/include/fstream Fri Aug 24 13:06:47 2012
@@ -261,12 +261,12 @@
       __owns_ib_(false),
       __always_noconv_(false)
 {
-    setbuf(0, 4096);
     if (has_facet<codecvt<char_type, char, state_type> >(this->getloc()))
     {
         __cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());
         __always_noconv_ = __cv_->always_noconv();
     }
+    setbuf(0, 4096);
 }
 
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES





More information about the cfe-commits mailing list