X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=actionlist.cc;h=f97e667a00c9a20273bbd7e146b4543d96776eda;hp=0dc8bc89661db7556d4fdc00344f8811d81be927;hb=25d73096cfc14c655f94b01bb235cc5efd1d5696;hpb=b453a87cb63371c235d5da1fc24fd8699a9c57b5 diff --git a/actionlist.cc b/actionlist.cc index 0dc8bc89..f97e667a 100644 --- a/actionlist.cc +++ b/actionlist.cc @@ -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 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; + } +}