protect base choice-point from nasty cutting.

This commit is contained in:
Vítor Santos Costa II 2010-04-13 00:31:25 +01:00
parent e605da8685
commit 661b9c3b7d

View File

@ -1943,7 +1943,7 @@ YAP_RestartGoal(void)
{ {
int out; int out;
BACKUP_MACHINE_REGS(); BACKUP_MACHINE_REGS();
if (Yap_AllowRestart) { if (Yap_AllowRestart) {
P = (yamop *)FAILCODE; P = (yamop *)FAILCODE;
do_putcf = myputc; do_putcf = myputc;
@ -2023,7 +2023,9 @@ YAP_PruneGoal(void)
B = B->cp_b; B = B->cp_b;
} }
Yap_TrimTrail(); Yap_TrimTrail();
B = B->cp_b; /* make sure that we do not destroy the guard choice-point */
if (Yap_op_from_opcode(B->cp_ap->opc) != _Nstop)
B = B->cp_b;
RECOVER_B(); RECOVER_B();
} }
@ -2619,6 +2621,7 @@ YAP_Reset(void)
} }
/* reinitialise the engine */ /* reinitialise the engine */
Yap_InitYaamRegs(); Yap_InitYaamRegs();
Yap_Initialised = TRUE;
RECOVER_MACHINE_REGS(); RECOVER_MACHINE_REGS();
return(TRUE); return(TRUE);