From: Brian Demsky Date: Thu, 9 Apr 2020 00:38:53 +0000 (-0700) Subject: Merge branch 'newactionlist' of ssh://plrg.eecs.uci.edu:/home/git/random-fuzzer into... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=b453a87cb63371c235d5da1fc24fd8699a9c57b5;hp=-c Merge branch 'newactionlist' of ssh://plrg.eecs.uci.edu:/home/git/random-fuzzer into newactionlist --- b453a87cb63371c235d5da1fc24fd8699a9c57b5 diff --combined actionlist.cc index 9f95384d,52569447..0dc8bc89 --- a/actionlist.cc +++ b/actionlist.cc @@@ -174,16 -174,15 +174,16 @@@ void actionlist::removeAction(ModelActi int shiftbits = MODELCLOCKBITS; modelclock_t clock = act->get_seq_number(); allnode * ptr = &root; + allnode * oldptr; modelclock_t currindex; while(shiftbits != 0) { shiftbits -= ALLBITS; currindex = (clock >> shiftbits) & ALLMASK; - allnode * tmp = ptr->children[currindex]; - if (tmp == NULL) + oldptr = ptr; + ptr = ptr->children[currindex]; + if (ptr == NULL) return; - ptr = tmp; } sllnode * llnode = reinterpret_cast *>(((uintptr_t) ptr) & ACTMASK); @@@ -206,11 -205,11 +206,11 @@@ if (first) { //see if previous node has same clock as us... if (llnodeprev != NULL && llnodeprev->val->get_seq_number() == clock) { - ptr->children[currindex] = reinterpret_cast(((uintptr_t)llnodeprev) | ISACT); + oldptr->children[currindex] = reinterpret_cast(((uintptr_t)llnodeprev) | ISACT); } else { //remove ourselves and go up tree - ptr->children[currindex] = NULL; - decrementCount(ptr); + oldptr->children[currindex] = NULL; + decrementCount(oldptr); } } delete llnode; @@@ -227,8 -226,7 +227,7 @@@ void actionlist::clear() { for(uint i = 0;i < ALLNODESIZE;i++) { if (root.children[i] != NULL) { - if (!(((uintptr_t) root.children[i]) & ISACT)) - delete root.children[i]; + delete root.children[i]; root.children[i] = NULL; } }