diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-22 21:58:00 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-22 21:58:00 -0400 |
commit | 14de0694a95ecd494d5d45f91e30ab9bee06182a (patch) | |
tree | 3f3ac0cca20e7274b7dfe2013c7a4834a5297dc4 /value.h | |
parent | f0f2b34ea9db64bdabe65119d3fd265308e6d205 (diff) | |
download | ledger-14de0694a95ecd494d5d45f91e30ab9bee06182a.tar.gz ledger-14de0694a95ecd494d5d45f91e30ab9bee06182a.tar.bz2 ledger-14de0694a95ecd494d5d45f91e30ab9bee06182a.zip |
Fixed a memory bug due to a shallow copy in value_t::storage_t.
Diffstat (limited to 'value.h')
-rw-r--r-- | value.h | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -164,13 +164,9 @@ private: explicit storage_t(const storage_t& rhs) : type(rhs.type), refc(0) { TRACE_CTOR(value_t::storage_t, ""); - std::memcpy(data, rhs.data, sizeof(data)); - } - storage_t& operator=(const storage_t& rhs) { - type = rhs.type; - std::memcpy(data, rhs.data, sizeof(data)); - return *this; + *this = rhs; } + storage_t& operator=(const storage_t& rhs); /** * Reference counting methods. The intrusive_ptr_* methods are |