diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-12 19:19:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-12 19:19:44 +0200 |
commit | e0578cc58a77223ba15f9582c026b84235f4843b (patch) | |
tree | abb43a77cd1f2d1c15ae460cbae72e4d38d3ee43 /common/session/custom/session.hxx | |
parent | 162eb7de6b2da9a28f224e33c72ebc3925b9632d (diff) |
Don't use uninitialized iterator on the rhs of assignment2.2.0
Diffstat (limited to 'common/session/custom/session.hxx')
-rw-r--r-- | common/session/custom/session.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index cda0258..6de140e 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -104,6 +104,17 @@ public: cache_position (): map_ (0) {} cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + cache_position& + operator= (const cache_position& p) + { + // It might not be ok to use an uninitialized iterator on the rhs. + // + if (p.map_ != 0) + pos_ = p.pos_; + map_ = p.map_; + return *this; + } + map* map_; iterator pos_; }; |