PR libstdc++/28277 (partial: money_get bits)
authorPaolo Carlini <pcarlini@suse.de>
Sun, 8 Oct 2006 01:13:03 +0000 (01:13 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 8 Oct 2006 01:13:03 +0000 (01:13 +0000)
2006-10-07  Paolo Carlini  <pcarlini@suse.de>

PR libstdc++/28277 (partial: money_get bits)
* include/bits/locale_facets.tcc (money_get<>::do_get(iter_type,
iter_type, bool, ios_base&, ios_base::iostate&, string_type&)):
Avoid __builtin_alloca with no limit, do the work in place.

From-SVN: r117549

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index f37f19a9d6994afc65da29617c2ed4944cc678c5..9c5b039550aad4b3553d74f3e13650057bd48e32 100644 (file)
@@ -1,3 +1,10 @@
+2006-10-07  Paolo Carlini  <pcarlini@suse.de>
+
+       PR libstdc++/28277 (partial: money_get bits)
+       * include/bits/locale_facets.tcc (money_get<>::do_get(iter_type,
+       iter_type, bool, ios_base&, ios_base::iostate&, string_type&)):
+       Avoid __builtin_alloca with no limit, do the work in place.
+
 2006-10-07  Ion Gaztanaga  <igaztanaga@gmail.com>
            Paolo Carlini  <pcarlini@suse.de>
 
index 6cf29333fbf282b53a12449cf5fce44712530be6..789df493c5ce9ae41a5a273717e9b9066f22ec05 100644 (file)
@@ -1565,7 +1565,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
     _InIter
     money_get<_CharT, _InIter>::
     do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
-          ios_base::iostate& __err, string_type& __units) const
+          ios_base::iostate& __err, string_type& __digits) const
     {
       typedef typename string::size_type                  size_type;
 
@@ -1580,10 +1580,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
       const size_type __len = __str.size();
       if (__len)
        {
-         _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
-                                                              * __len));
-         __ctype.widen(__str.data(), __str.data() + __len, __ws);
-         __units.assign(__ws, __len);
+         __digits.resize(__len);
+         __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
        }
 
       return __ret;