Fix asserta_static
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@882 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
57c6e21bcd
commit
cf148cd0cb
@ -818,8 +818,13 @@ asserta_stat_clause(PredEntry *p, yamop *cp, int spy_flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p->cs.p_code.FirstClause = cp;
|
p->cs.p_code.FirstClause = cp;
|
||||||
if (!(p->PredFlags & IndexedPredFlag)) {
|
|
||||||
p->cs.p_code.TrueCodeOfPred = cp;
|
p->cs.p_code.TrueCodeOfPred = cp;
|
||||||
|
if (p->PredFlags & SpiedPredFlag) {
|
||||||
|
p->OpcodeOfPred = Yap_opcode(_spy_pred);
|
||||||
|
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
||||||
|
} else if (!(p->PredFlags & IndexedPredFlag)) {
|
||||||
|
p->OpcodeOfPred = INDEX_OPCODE;
|
||||||
|
p->CodeOfPred = (yamop *)(&(p->OpcodeOfPred));
|
||||||
}
|
}
|
||||||
p->cs.p_code.LastClause->u.ld.d = cp;
|
p->cs.p_code.LastClause->u.ld.d = cp;
|
||||||
}
|
}
|
||||||
|
16
C/index.c
16
C/index.c
@ -3314,16 +3314,28 @@ yamop *
|
|||||||
Yap_PredIsIndexable(PredEntry *ap)
|
Yap_PredIsIndexable(PredEntry *ap)
|
||||||
{
|
{
|
||||||
yamop *indx_out;
|
yamop *indx_out;
|
||||||
|
int setjres;
|
||||||
|
|
||||||
Yap_Error_Size = 0;
|
Yap_Error_Size = 0;
|
||||||
if (setjmp(Yap_CompilerBotch) == 3) {
|
if ((setjres = setjmp(Yap_CompilerBotch)) == 3) {
|
||||||
restore_machine_regs();
|
restore_machine_regs();
|
||||||
Yap_gcl(Yap_Error_Size, ap->ArityOfPE, ENV, CP);
|
Yap_gcl(Yap_Error_Size, ap->ArityOfPE, ENV, CP);
|
||||||
|
} else if (setjres == 2) {
|
||||||
|
restore_machine_regs();
|
||||||
|
if (!Yap_growheap(FALSE, Yap_Error_Size)) {
|
||||||
|
Yap_Error(SYSTEM_ERROR, TermNil, Yap_ErrorMessage);
|
||||||
|
return FAILCODE;
|
||||||
|
}
|
||||||
|
} else if (setjres != 0) {
|
||||||
|
if (!Yap_growheap(FALSE, Yap_Error_Size)) {
|
||||||
|
Yap_Error(SYSTEM_ERROR, TermNil, Yap_ErrorMessage);
|
||||||
|
return FAILCODE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
restart_index:
|
restart_index:
|
||||||
Yap_ErrorMessage = NULL;
|
Yap_ErrorMessage = NULL;
|
||||||
if (compile_index(ap) == (UInt)FAILCODE) {
|
if (compile_index(ap) == (UInt)FAILCODE) {
|
||||||
return NULL;
|
return FAILCODE;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (Yap_Option['i' - 'a' + 1]) {
|
if (Yap_Option['i' - 'a' + 1]) {
|
||||||
|
Reference in New Issue
Block a user