summaryrefslogtreecommitdiff
path: root/value.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-22 21:58:00 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-22 21:58:00 -0400
commit14de0694a95ecd494d5d45f91e30ab9bee06182a (patch)
tree3f3ac0cca20e7274b7dfe2013c7a4834a5297dc4 /value.h
parentf0f2b34ea9db64bdabe65119d3fd265308e6d205 (diff)
downloadledger-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.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/value.h b/value.h
index e5418995..721d6d63 100644
--- a/value.h
+++ b/value.h
@@ -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