Commit dc2a0796 by Paolo Carlini Committed by Paolo Carlini

PR libstdc++/28277 (partial: money_get bits)

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
parent bcec6539
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> 2006-10-07 Ion Gaztanaga <igaztanaga@gmail.com>
Paolo Carlini <pcarlini@suse.de> Paolo Carlini <pcarlini@suse.de>
......
...@@ -1565,7 +1565,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE ...@@ -1565,7 +1565,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
_InIter _InIter
money_get<_CharT, _InIter>:: money_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, 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; typedef typename string::size_type size_type;
...@@ -1580,10 +1580,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE ...@@ -1580,10 +1580,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
const size_type __len = __str.size(); const size_type __len = __str.size();
if (__len) if (__len)
{ {
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) __digits.resize(__len);
* __len)); __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
__ctype.widen(__str.data(), __str.data() + __len, __ws);
__units.assign(__ws, __len);
} }
return __ret; return __ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment