diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-25 04:38:58 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-25 05:01:47 -0400 |
commit | e2875f47ec1364ae06312ebf4104c3a0213fc78c (patch) | |
tree | 84ec0278fc8321b27ec241aefd34451755ba1851 /src/value.h | |
parent | 26ae1fdfad62a15a0762c052ed9785f3c0d5be29 (diff) | |
download | fork-ledger-e2875f47ec1364ae06312ebf4104c3a0213fc78c.tar.gz fork-ledger-e2875f47ec1364ae06312ebf4104c3a0213fc78c.tar.bz2 fork-ledger-e2875f47ec1364ae06312ebf4104c3a0213fc78c.zip |
Added some extra storage checks to value_t
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h index b40b9d28..23c8c8d5 100644 --- a/src/value.h +++ b/src/value.h @@ -211,6 +211,8 @@ private: void destroy() { DEBUG("value.storage.refcount", "Destroying " << this); switch (type) { + case VOID: + return; case BALANCE: checked_delete(boost::get<balance_t *>(data)); break; @@ -220,6 +222,7 @@ private: default: break; } + data = false; type = VOID; } }; @@ -635,10 +638,12 @@ public: void set_string(const string& val = "") { set_type(STRING); storage->data = val; + VERIFY(boost::get<string>(storage->data) == val); } void set_string(const char * val = "") { set_type(STRING); storage->data = string(val); + VERIFY(boost::get<string>(storage->data) == val); } bool is_mask() const { |