diff options
author | Paolo Carlini <pcarlini@suse.de> | 2006-10-08 01:13:03 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2006-10-08 01:13:03 +0000 |
commit | dc2a0796072c90fef8cdbf7c7b8e00fba7df4254 (patch) | |
tree | 8ad6d6f1966026b9126ae4a123dd600763a62979 | |
parent | bcec65390e8dc99914ec6d8f763c3aaffb6d80b7 (diff) | |
download | gcc-dc2a0796072c90fef8cdbf7c7b8e00fba7df4254.zip gcc-dc2a0796072c90fef8cdbf7c7b8e00fba7df4254.tar.gz gcc-dc2a0796072c90fef8cdbf7c7b8e00fba7df4254.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/locale_facets.tcc | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f37f19a..9c5b039 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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> diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 6cf2933..789df49 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -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; |