This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/28277 (money_get bits)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 08 Oct 2006 03:16:12 +0200
- Subject: [v3] libstdc++/28277 (money_get bits)
Hi,
tested x86-linux, committed to mainline.
Paolo.
//////////////////
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.
Index: include/bits/locale_facets.tcc
===================================================================
--- include/bits/locale_facets.tcc (revision 117528)
+++ include/bits/locale_facets.tcc (working copy)
@@ -1565,7 +1565,7 @@
_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 @@
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;