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;
|
newpc = ipc->u.OtILl.d;
|
||||||
}
|
}
|
||||||
#if MULTIPLE_STACKS
|
#if MULTIPLE_STACKS
|
||||||
|
DEC_CLREF_COUNT(cl);
|
||||||
B->cp_tr--;
|
B->cp_tr--;
|
||||||
TR--;
|
TR--;
|
||||||
DEC_CLREF_COUNT(cl);
|
|
||||||
/* actually get rid of the code */
|
/* actually get rid of the code */
|
||||||
if (cl->ClRefCount == 0 && cl->ClFlags & (ErasedMask|DirtyMask)) {
|
if (cl->ClRefCount == 0 && cl->ClFlags & (ErasedMask|DirtyMask)) {
|
||||||
/* I am the last one using this clause, hence I don't need a lock
|
/* 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;
|
LogUpdClause *lcl = ipc->u.OtILl.d;
|
||||||
if (newpc) {
|
if (newpc) {
|
||||||
/* I am the last one using this clause, hence I don't need a lock
|
if (lcl->ClRefCount == 1) {
|
||||||
to dispose of it
|
/* make sure the clause isn't destroyed */
|
||||||
*/
|
/* always add an extra reference */
|
||||||
/* make sure the clause isn't destroyed */
|
INC_CLREF_COUNT(lcl);
|
||||||
/* always add an extra reference */
|
TRAIL_CLREF(lcl);
|
||||||
INC_CLREF_COUNT(lcl);
|
B->cp_tr = TR;
|
||||||
TRAIL_CLREF(lcl);
|
}
|
||||||
}
|
}
|
||||||
if (cl->ClFlags & ErasedMask) {
|
if (cl->ClFlags & ErasedMask) {
|
||||||
Yap_ErLogUpdIndex(cl);
|
Yap_ErLogUpdIndex(cl);
|
||||||
} else {
|
} else {
|
||||||
Yap_CleanUpIndex(cl);
|
Yap_CleanUpIndex(cl);
|
||||||
}
|
}
|
||||||
if (newpc) {
|
|
||||||
DEC_CLREF_COUNT(lcl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
|
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
|
||||||
|
Reference in New Issue
Block a user