diff --git a/C/absmi.c b/C/absmi.c index 759c6463f..67d2f292b 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -2204,7 +2204,9 @@ Yap_absmi(int inp) SET_ASP(YREG, PREG->u.s.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l); /* assume cut is always in stack */ + saveregs(); prune((choiceptr)YREG[E_CB]); + setregs(); GONext(); ENDOp(); @@ -2221,7 +2223,9 @@ Yap_absmi(int inp) #endif SET_ASP(YREG, PREG->u.s.s); /* assume cut is always in stack */ + saveregs(); prune((choiceptr)YREG[E_CB]); + setregs(); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l); #ifdef FROZEN_STACKS { @@ -2255,7 +2259,9 @@ Yap_absmi(int inp) #endif SET_ASP(YREG, PREG->u.s.s); PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l); + saveregs(); prune((choiceptr)SREG[E_CB]); + setregs(); GONext(); ENDOp(); @@ -2306,7 +2312,9 @@ Yap_absmi(int inp) #else pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0)); #endif /* SBA && FROZEN_STACKS */ + saveregs(); prune(pt0); + setregs(); } GONext(); @@ -2340,7 +2348,9 @@ Yap_absmi(int inp) #else pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0)); #endif + saveregs(); prune(pt0); + setregs(); } GONext(); @@ -14059,7 +14069,9 @@ Yap_absmi(int inp) if (at == AtomCut) { choiceptr cut_pt = (choiceptr)pt0[E_CB]; SET_ASP(YREG, E_CB*sizeof(CELL)); + saveregs(); prune(cut_pt); + setregs(); } pen = RepPredProp(PredPropByAtom(at, mod)); goto execute_comma; @@ -14137,7 +14149,9 @@ Yap_absmi(int inp) } else if ((Atom)(pen->FunctorOfPred) == AtomCut) { choiceptr cut_pt = (choiceptr)pt0[E_CB]; SET_ASP(YREG, E_CB*sizeof(CELL)); + saveregs(); prune(cut_pt); + setregs(); } execute_after_comma: diff --git a/C/iopreds.c b/C/iopreds.c index 901b1771e..f4c89ddb9 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -848,7 +848,7 @@ p_read (void) return do_read(NULL, 6); } -extern int getInputStream(int, IOSTREAM **); +extern int getInputStream(Int, IOSTREAM **); static Int p_read2 (void) diff --git a/H/absmi.h b/H/absmi.h index 85b13987f..0515c3fea 100644 --- a/H/absmi.h +++ b/H/absmi.h @@ -1569,7 +1569,7 @@ prune(choiceptr cp) #ifdef YAPOR CUT_prune_to(cp); #endif /* YAPOR */ - /* cut ! */ + /* cut ! */ #ifdef TABLING abolish_incomplete_subgoals(B); #endif /* TABLING */ diff --git a/H/trim_trail.h b/H/trim_trail.h index be3ce5910..098752751 100644 --- a/H/trim_trail.h +++ b/H/trim_trail.h @@ -47,12 +47,10 @@ if (erase) { /* at this point, we are the only ones accessing the clause, hence we don't need to have a lock it */ - saveregs(); if (cl->ClFlags & ErasedMask) Yap_ErLogUpdIndex(cl); else Yap_CleanUpIndex(cl); - setregs(); } UNLOCK(ap->PELock); } else { diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 31c35181f..56a7ba12f 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -2799,7 +2799,7 @@ Yap_CloseStreams(int loud) closeFiles(FALSE); } -int Yap_StreamToFileNo(Term t) { +Int Yap_StreamToFileNo(Term t) { IOSTREAM *s; int rc; @@ -2818,7 +2818,7 @@ FILE *Yap_FileDescriptorFromStream(Term t) fprintf(stderr,"Unimplemented\n"); // return Sfileno(s); } - return -1; + return NULL; } #ifdef _WIN32