edits
[c11tester.git] / actionlist.cc
index 0dc8bc89661db7556d4fdc00344f8811d81be927..4a24ba9952a32bffbefdbdf418a031d6ac1db412 100644 (file)
@@ -246,3 +246,16 @@ void actionlist::clear() {
 bool actionlist::isEmpty() {
        return root.count == 0;
 }
+
+/**
+ * Fix the parent pointer of root when root address changes (possible
+ * due to vector<action_list_t> resize)
+ */
+void actionlist::fixupParent()
+{
+       for (int i = 0; i < ALLNODESIZE; i++) {
+               allnode * child = root.children[i];
+               if (child != NULL && child->parent != &root)
+                       child->parent = &root;
+       }
+}