fix bad messup with program counter (obs from Ingo Molnar).q

This commit is contained in:
Vitor Santos Costa 2010-08-17 13:02:50 +01:00
parent 3e6ce40eb1
commit ace9025c10

View File

@ -7563,12 +7563,17 @@ Yap_absmi(int inp)
} }
/* for slots to work */ /* for slots to work */
#endif /* FROZEN_STACKS */ #endif /* FROZEN_STACKS */
{
/* make sure that we can still have access to our old PREG after calling user defined goals and backtracking or failing */
yamop *savedP;
Yap_StartSlots(); Yap_StartSlots();
Yap_PrologMode = UserCCallMode; Yap_PrologMode = UserCCallMode;
{ {
PredEntry *p = PREG->u.Osbpp.p; PredEntry *p = PREG->u.Osbpp.p;
PREG = NEXTOP(PREG, Osbpp); PREG = NEXTOP(PREG, Osbpp);
savedP = PREG;
saveregs(); saveregs();
save_machine_regs(); save_machine_regs();
@ -7578,6 +7583,8 @@ Yap_absmi(int inp)
setregs(); setregs();
Yap_PrologMode = UserMode; Yap_PrologMode = UserMode;
restore_machine_regs(); restore_machine_regs();
PREG = savedP;
}
if (EX) { if (EX) {
struct DB_TERM *exp = EX; struct DB_TERM *exp = EX;
EX = NULL; EX = NULL;