asserting on a spied predicate might make it loop for ever :(
This commit is contained in:
parent
e204a8b7a3
commit
3c84466d05
@ -1830,10 +1830,7 @@ assertz_stat_clause(PredEntry *p, yamop *cp, int spy_flag)
|
|||||||
clp->ClPrev = clq;
|
clp->ClPrev = clq;
|
||||||
clp->ClNext = NULL;
|
clp->ClNext = NULL;
|
||||||
p->cs.p_code.LastClause = cp;
|
p->cs.p_code.LastClause = cp;
|
||||||
if (p->PredFlags & SpiedPredFlag) {
|
if (!(p->PredFlags & IndexedPredFlag)) {
|
||||||
p->OpcodeOfPred = Yap_opcode(_spy_pred);
|
|
||||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
|
||||||
} else if (!(p->PredFlags & IndexedPredFlag)) {
|
|
||||||
p->OpcodeOfPred = INDEX_OPCODE;
|
p->OpcodeOfPred = INDEX_OPCODE;
|
||||||
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
||||||
}
|
}
|
||||||
@ -1843,6 +1840,10 @@ assertz_stat_clause(PredEntry *p, yamop *cp, int spy_flag)
|
|||||||
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (p->PredFlags & SpiedPredFlag) {
|
||||||
|
p->OpcodeOfPred = Yap_opcode(_spy_pred);
|
||||||
|
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
StaticClause *cl = ClauseCodeToStaticClause(pt);
|
StaticClause *cl = ClauseCodeToStaticClause(pt);
|
||||||
|
Reference in New Issue
Block a user