diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-05-29 10:19:53 -0700 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:31 +0100 |
commit | 64f8068bb77c589566836b5ebb7cd719fa883c29 (patch) | |
tree | f27e3dfdd56af554c4624e2987e6091b330123b5 /Carpet/CarpetLib/src/bintree.cc | |
parent | 3af3dfa78c78075b962b639fcd93cb2714a0f825 (diff) |
CarpetLib: add self-copy logic to classes with pointer members
right now disabled by an assert
Diffstat (limited to 'Carpet/CarpetLib/src/bintree.cc')
-rw-r--r-- | Carpet/CarpetLib/src/bintree.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/bintree.cc b/Carpet/CarpetLib/src/bintree.cc index db3b27e1c..59c1e0a84 100644 --- a/Carpet/CarpetLib/src/bintree.cc +++ b/Carpet/CarpetLib/src/bintree.cc @@ -75,6 +75,9 @@ template <typename T, int D, typename P> bintree<T,D,P> & bintree<T,D,P>::operator= (bintree const & t) { + assert (&t != this); // subtree delet handling is currently incorrect in this case + if (&t == this) return *this; // nothing to do + assert (invariant()); if (is_branch()) { for (int i=0; i<2; ++i) { |