asserting on a spied predicate might make it loop for ever :(

This commit is contained in:
Vitor Santos Costa 2009-04-21 18:51:01 -05:00
parent e204a8b7a3
commit 3c84466d05

View File

@ -1830,10 +1830,7 @@ assertz_stat_clause(PredEntry *p, yamop *cp, int spy_flag)
clp->ClPrev = clq;
clp->ClNext = NULL;
p->cs.p_code.LastClause = cp;
if (p->PredFlags & SpiedPredFlag) {
p->OpcodeOfPred = Yap_opcode(_spy_pred);
p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
} else if (!(p->PredFlags & IndexedPredFlag)) {
if (!(p->PredFlags & IndexedPredFlag)) {
p->OpcodeOfPred = INDEX_OPCODE;
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));
}
#endif
if (p->PredFlags & SpiedPredFlag) {
p->OpcodeOfPred = Yap_opcode(_spy_pred);
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
}
return;
} else {
StaticClause *cl = ClauseCodeToStaticClause(pt);