[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Konstantinos Poulios |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Thu, 14 Sep 2017 09:56:24 -0400 (EDT) |
branch: fix-valgrind-issues
commit 830123b260a1854242fff9dfaceca9fd8c288238
Author: Konstantinos Poulios <address@hidden>
Date: Thu Sep 14 15:56:15 2017 +0200
add debugging questions/info (not to be pushed to master)
---
src/getfem_generic_assembly.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/getfem_generic_assembly.cc b/src/getfem_generic_assembly.cc
index 6607028..baba57f 100644
--- a/src/getfem_generic_assembly.cc
+++ b/src/getfem_generic_assembly.cc
@@ -728,6 +728,7 @@ namespace getfem {
}
source_node->children.resize(0); // so that the destructor of source_node
// will not destruct the children
+GMM_ASSERT1(current_node->children.size() == 0, "current_node->children not
empty");
current_node->children = new_children;
}
@@ -753,6 +754,7 @@ namespace getfem {
new_node->adopt_child(current_node);
}
} else {
+ //FIXME: shouldn't we set root->parent = new_node ? Use adopt_child?
if (root) new_node->children.push_back(root);
root = new_node;
root->parent = nullptr;
@@ -9449,6 +9451,8 @@ namespace getfem {
pnode_old->parent->replace_child(pnode_old, pnode);
else
tree.root = pnode;
+// shouldn't we also delete pnode_old's children if there are any? Adding an
assert to catch this
+GMM_ASSERT1(pnode_old->children.empty(), "Internal error");
delete pnode_old;
ga_node_analysis(expr, tree, workspace, pnode, meshdim,
ref_elt_dim, eval_fixed_size, ignore_X, option);
@@ -10016,6 +10020,9 @@ namespace getfem {
result_tree.insert_node(result_tree.root, pnode->node_type);
result_tree.root->pos = pnode->pos;
result_tree.root->children.resize(pnode->children.size(), nullptr);
+// There is something strange in the following, isn't
result_tree.root->children[0] just a nullptr?
+// Adding an assert to catch it.
+GMM_ASSERT1(result_tree.root->children[0], "Internal error");
result_tree.root->children[1] = result_tree.root->children[0];
for (size_type i = 0; i < pnode->children.size(); ++i) {
if (i != 1) {