fix P details when creating execution environment: we should save the old one

This commit is contained in:
Vítor Santos Costa
2013-09-08 22:24:09 +01:00
parent 4c148cc0d3
commit 6966d23195
4 changed files with 7 additions and 2 deletions

View File

@@ -2289,8 +2289,9 @@ YAP_EnterGoal(PredEntry *pe, Term *ptr, YAP_dogoalinfo *dgi)
BACKUP_MACHINE_REGS();
dgi->p = P;
dgi->cp = CP;
P = pe->CodeOfPred;
// ensure our current ENV receives current P.
Yap_PrepGoal(pe->ArityOfPE, ptr, B PASS_REGS);
P = pe->CodeOfPred;
dgi->b = LCL0-(CELL*)B;
out = run_emulator(dgi PASS_REGS);
RECOVER_MACHINE_REGS();