bad ref counting with trust_log/threads
This commit is contained in:
parent
474c088baf
commit
3917a19ab9
19
C/index.c
19
C/index.c
@ -6300,9 +6300,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
newpc = ipc->u.OtILl.d;
|
||||
}
|
||||
#if MULTIPLE_STACKS
|
||||
DEC_CLREF_COUNT(cl);
|
||||
B->cp_tr--;
|
||||
TR--;
|
||||
DEC_CLREF_COUNT(cl);
|
||||
/* actually get rid of the code */
|
||||
if (cl->ClRefCount == 0 && cl->ClFlags & (ErasedMask|DirtyMask)) {
|
||||
/* I am the last one using this clause, hence I don't need a lock
|
||||
@ -6311,22 +6311,19 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
*/
|
||||
LogUpdClause *lcl = ipc->u.OtILl.d;
|
||||
if (newpc) {
|
||||
/* I am the last one using this clause, hence I don't need a lock
|
||||
to dispose of it
|
||||
*/
|
||||
/* make sure the clause isn't destroyed */
|
||||
/* always add an extra reference */
|
||||
INC_CLREF_COUNT(lcl);
|
||||
TRAIL_CLREF(lcl);
|
||||
if (lcl->ClRefCount == 1) {
|
||||
/* make sure the clause isn't destroyed */
|
||||
/* always add an extra reference */
|
||||
INC_CLREF_COUNT(lcl);
|
||||
TRAIL_CLREF(lcl);
|
||||
B->cp_tr = TR;
|
||||
}
|
||||
}
|
||||
if (cl->ClFlags & ErasedMask) {
|
||||
Yap_ErLogUpdIndex(cl);
|
||||
} else {
|
||||
Yap_CleanUpIndex(cl);
|
||||
}
|
||||
if (newpc) {
|
||||
DEC_CLREF_COUNT(lcl);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
|
||||
|
Reference in New Issue
Block a user