C-interface

This commit is contained in:
Vítor Santos Costa
2018-09-18 19:27:10 +01:00
parent 7661b8581c
commit a6e578090c
6 changed files with 36 additions and 22 deletions

View File

@@ -1813,21 +1813,23 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) {
//&& LOCAL_CBorder > LCL0 - (CELL *)handler
//&& handler->cp_ap != NOCODE
&& handler->cp_b != NULL
&& handler != myB
&& handler <= myB
) {
handler->cp_ap = TRUSTFAILCODE;
handler = handler->cp_b;
}
if (LOCAL_PrologMode & AsyncIntMode) {
Yap_signal(YAP_FAIL_SIGNAL);
}
B = handler;
handler = handler->cp_b;
if (successful) {
Yap_TrimTrail();
CP = dgi->cp;
P = dgi->p;
} else {
P=FAILCODE;
Yap_exec_absmi(true, YAP_EXEC_ABSMI);
}
}
if (successful) {
CP = dgi->cp;
P = dgi->p;
} else {
LOCAL_CurSlot = dgi->CurSlot;
ENV = YENV = B->cp_env;
HR = B->cp_h;
@@ -1835,6 +1837,11 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) {
// use the current choicepoint
// B=B->cp_b;
ASP=(CELL*)B;
}
if (B)
B = B->cp_b;
if (LOCAL_PrologMode & AsyncIntMode) {
Yap_signal(YAP_FAIL_SIGNAL);
}
RECOVER_MACHINE_REGS();
// fprintf(stderr,"LeftGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p Slots=%d\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot);