aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/fulltree.cc
diff options
context:
space:
mode:
authorRoland Haas <roland.haas@physics.gatech.edu>2012-05-29 10:19:53 -0700
committerRoland Haas <roland.haas@physics.gatech.edu>2012-05-29 10:19:53 -0700
commitc79611aa3ee3d5782a7e2c42e0895dbf50cce355 (patch)
tree98025853ec8c20f50d7102d9df7545f40bfc2b20 /Carpet/CarpetLib/src/fulltree.cc
parenta499fb9529164f6c9193abe00f5191f9c6cf6dc5 (diff)
CarpetLib: add self-copy logic to classes with pointer members
right now disabled by an assert
Diffstat (limited to 'Carpet/CarpetLib/src/fulltree.cc')
-rw-r--r--Carpet/CarpetLib/src/fulltree.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/fulltree.cc b/Carpet/CarpetLib/src/fulltree.cc
index d482691cf..202d59b77 100644
--- a/Carpet/CarpetLib/src/fulltree.cc
+++ b/Carpet/CarpetLib/src/fulltree.cc
@@ -77,6 +77,9 @@ template <typename T, int D, typename P>
fulltree<T,D,P> &
fulltree<T,D,P>::operator= (fulltree 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 (size_t i=0; i<subtrees.size(); ++i) {