cut_succeed and cut_fail should recover pool of try_c and should
do trim_trail (not that the latter really matters).
This commit is contained in:
parent
4283f44ebc
commit
bcc4a27206
@ -7713,13 +7713,6 @@ Yap_absmi(int inp)
|
||||
setregs();
|
||||
Yap_PrologMode = UserMode;
|
||||
if (!SREG) {
|
||||
#ifdef CUT_C
|
||||
/* Removes the cut functions from the stack
|
||||
without executing them because we have fail
|
||||
and not cuted the predicate*/
|
||||
while(POP_CHOICE_POINT(B))
|
||||
cut_c_pop();
|
||||
#endif
|
||||
FAIL();
|
||||
}
|
||||
if ((CELL *) B == YREG && ASP != (CELL *) B) {
|
||||
|
4
H/Regs.h
4
H/Regs.h
@ -722,10 +722,6 @@ EXTERN inline void restore_B(void) {
|
||||
#define ARG15 XREGS[15]
|
||||
#define ARG16 XREGS[16]
|
||||
|
||||
#define cut_succeed() return( ( B = B->cp_b, 1 ))
|
||||
#define cut_fail() return( ( B = B->cp_b, 0 ))
|
||||
|
||||
|
||||
/* by default, define HBREG to be HB */
|
||||
|
||||
#define HBREG HB
|
||||
|
14
H/amiops.h
14
H/amiops.h
@ -513,3 +513,17 @@ Yap_unify_constant(register Term a, register Term cons)
|
||||
#define LT_OK_IN_CMP 2
|
||||
#define GT_OK_IN_CMP 4
|
||||
|
||||
static inline int
|
||||
do_cut(int i) {
|
||||
while (POP_CHOICE_POINT(B->cp_b)) {
|
||||
cut_c_pop();
|
||||
}
|
||||
Yap_TrimTrail();
|
||||
B = B->cp_b;
|
||||
return i;
|
||||
}
|
||||
|
||||
#define cut_succeed() return do_cut(TRUE)
|
||||
|
||||
#define cut_fail() return do_cut(FALSE)
|
||||
|
||||
|
Reference in New Issue
Block a user