diff options
| author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-28 14:38:39 +0000 |
|---|---|---|
| committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-28 14:38:39 +0000 |
| commit | 9bc3759c8b71c76e98b56d0aeabcee39d2ac16b6 (patch) | |
| tree | 5c8106b92de832cfc0dac54b31bebfc68e200850 | |
| parent | 263a2d414943fbbca87c32b428996f2fc0755a17 (diff) | |
| download | ppe42-gcc-9bc3759c8b71c76e98b56d0aeabcee39d2ac16b6.tar.gz ppe42-gcc-9bc3759c8b71c76e98b56d0aeabcee39d2ac16b6.zip | |
2000-06-28 Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
* bits/valarray_array.h (_Array_default_ctor<>::_S_do_it): Don't
forget the sizeof(_Tp) factor in call to memset().
(_Array_copy_ctor<>::_S_do_it): Likewise for memcpy().
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34757 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | libstdc++-v3/bits/valarray_array.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/bits/valarray_array.h b/libstdc++-v3/bits/valarray_array.h index fc610ee0def..c2f40c39127 100644 --- a/libstdc++-v3/bits/valarray_array.h +++ b/libstdc++-v3/bits/valarray_array.h @@ -73,7 +73,7 @@ namespace std // For fundamental types, it suffices to say 'memset()' inline static void _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e) - { memset(__b, 0, __e - __b); } + { memset(__b, 0, (__e - __b)*sizeof(_Tp)); } }; template<typename _Tp> @@ -135,7 +135,7 @@ namespace std inline static void _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e, _Tp* __restrict__ __o) - { memcpy(__o, __b, __e - __b); } + { memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); } }; template<typename _Tp> |

