projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c07babd
)
Fix mistakes in refactoring
author
Brian Demsky
<bdemsky@uci.edu>
Thu, 9 Apr 2020 00:38:29 +0000
(17:38 -0700)
committer
Brian Demsky
<bdemsky@uci.edu>
Thu, 9 Apr 2020 00:38:29 +0000
(17:38 -0700)
actionlist.cc
patch
|
blob
|
history
diff --git
a/actionlist.cc
b/actionlist.cc
index 68345986f2a185c6f0931bc64763fb3df49dd0cc..9f95384d1ac487d94906b99612a69c7e8eb8ba65 100644
(file)
--- a/
actionlist.cc
+++ b/
actionlist.cc
@@
-174,15
+174,16
@@
void actionlist::removeAction(ModelAction * act) {
int shiftbits = MODELCLOCKBITS;
modelclock_t clock = act->get_seq_number();
allnode * ptr = &root;
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;
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;
return;
- ptr = tmp;
}
sllnode<ModelAction *> * llnode = reinterpret_cast<sllnode<ModelAction *> *>(((uintptr_t) ptr) & ACTMASK);
}
sllnode<ModelAction *> * llnode = reinterpret_cast<sllnode<ModelAction *> *>(((uintptr_t) ptr) & ACTMASK);
@@
-205,11
+206,11
@@
void actionlist::removeAction(ModelAction * act) {
if (first) {
//see if previous node has same clock as us...
if (llnodeprev != NULL && llnodeprev->val->get_seq_number() == clock) {
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<allnode *>(((uintptr_t)llnodeprev) | ISACT);
+
old
ptr->children[currindex] = reinterpret_cast<allnode *>(((uintptr_t)llnodeprev) | ISACT);
} else {
//remove ourselves and go up tree
} else {
//remove ourselves and go up tree
- ptr->children[currindex] = NULL;
- decrementCount(ptr);
+
old
ptr->children[currindex] = NULL;
+ decrementCount(
old
ptr);
}
}
delete llnode;
}
}
delete llnode;