fix fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@943 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
8dc293eba4
commit
2fbad3d467
29
C/cdmgr.c
29
C/cdmgr.c
@ -3126,16 +3126,6 @@ p_log_update_clause(void)
|
||||
if (pe == NULL || EndOfPAEntr(pe))
|
||||
return FALSE;
|
||||
WRITE_LOCK(pe->PRWLock);
|
||||
if (pe->ModuleOfPred != 2 &&
|
||||
pe->ArityOfPE) {
|
||||
UInt i;
|
||||
CELL *tar = RepAppl(t1);
|
||||
|
||||
/* makes no sense for IDB, as ArityOfPE means nothing */
|
||||
for (i = 1; i <= pe->ArityOfPE; i++) {
|
||||
XREGS[i] = tar[i];
|
||||
}
|
||||
}
|
||||
if(pe->OpcodeOfPred == INDEX_OPCODE) {
|
||||
IPred(pe);
|
||||
}
|
||||
@ -3216,16 +3206,6 @@ p_log_update_clause0(void)
|
||||
if (pe == NULL || EndOfPAEntr(pe))
|
||||
return FALSE;
|
||||
WRITE_LOCK(pe->PRWLock);
|
||||
if (pe->ModuleOfPred != 2 &&\
|
||||
pe->ArityOfPE) {
|
||||
UInt i;
|
||||
CELL *tar = RepAppl(t1);
|
||||
|
||||
/* makes no sense for IDB, as ArityOfPE means nothing */
|
||||
for (i = 1; i <= pe->ArityOfPE; i++) {
|
||||
XREGS[i] = tar[i];
|
||||
}
|
||||
}
|
||||
if(pe->OpcodeOfPred == INDEX_OPCODE) {
|
||||
IPred(pe);
|
||||
}
|
||||
@ -3308,15 +3288,6 @@ p_static_clause(void)
|
||||
if (pe == NULL || EndOfPAEntr(pe))
|
||||
return FALSE;
|
||||
WRITE_LOCK(pe->PRWLock);
|
||||
if (pe->ArityOfPE &&
|
||||
pe->ArityOfPE) {
|
||||
UInt i;
|
||||
CELL *tar = RepAppl(t1);
|
||||
|
||||
for (i = 1; i <= pe->ArityOfPE; i++) {
|
||||
XREGS[i] = tar[i];
|
||||
}
|
||||
}
|
||||
if(pe->OpcodeOfPred == INDEX_OPCODE) {
|
||||
IPred(pe);
|
||||
}
|
||||
|
25
C/index.c
25
C/index.c
@ -6069,6 +6069,16 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term t1, Term tb, Term tr, yam
|
||||
yamop **jlbl = NULL;
|
||||
int lu_pred = ap->PredFlags & LogUpdatePredFlag;
|
||||
|
||||
if (ap->ModuleOfPred != 2) {
|
||||
if (ap->ArityOfPE) {
|
||||
CELL *tar = RepAppl(t1);
|
||||
UInt i;
|
||||
|
||||
for (i = 1; i <= ap->ArityOfPE; i++) {
|
||||
XREGS[i] = tar[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
/* try to refine the interval using the indexing code */
|
||||
while (ipc != NULL) {
|
||||
op_numbers op = Yap_op_from_opcode(ipc->opc);
|
||||
@ -6077,9 +6087,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term t1, Term tb, Term tr, yam
|
||||
case _try_in:
|
||||
update_clause_choice_point(NEXTOP(ipc,l), ap_pc);
|
||||
if (lu_pred)
|
||||
return lu_clause(ipc->u.ld.d);
|
||||
return lu_clause(ipc->u.l.l);
|
||||
else
|
||||
return static_clause(ipc->u.ld.d);
|
||||
return static_clause(ipc->u.l.l);
|
||||
break;
|
||||
case _try_clause:
|
||||
if (b0 == NULL)
|
||||
@ -6416,6 +6426,17 @@ Yap_NthClause(PredEntry *ap, Int ncls)
|
||||
else if (ncls < 0)
|
||||
return NULL;
|
||||
|
||||
if (ap->ModuleOfPred != 2) {
|
||||
if (ap->ArityOfPE) {
|
||||
UInt i;
|
||||
|
||||
for (i = 1; i <= ap->ArityOfPE; i++) {
|
||||
XREGS[i] = MkVarTerm();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ARG2 = MkVarTerm();
|
||||
}
|
||||
while (TRUE) {
|
||||
op_numbers op = Yap_op_from_opcode(ipc->opc);
|
||||
|
||||
|
Reference in New Issue
Block a user