fix slot initialization problem.

This commit is contained in:
Vítor Santos Costa 2010-12-13 20:39:12 +00:00
parent 9f8f8ee73e
commit 3933ee4053

View File

@ -1002,6 +1002,8 @@ exec_absmi(int top)
Yap_PrologMode = UserMode; Yap_PrologMode = UserMode;
} }
Yap_CloseSlots(); Yap_CloseSlots();
YENV = ASP;
YENV[E_CB] = Unsigned (B);
out = Yap_absmi(0); out = Yap_absmi(0);
Yap_StartSlots(); Yap_StartSlots();
/* make sure we don't leave a FAIL signal hanging around */ /* make sure we don't leave a FAIL signal hanging around */
@ -1019,6 +1021,9 @@ init_stack(int arity, CELL *pt, int top, choiceptr saved_b)
collection is going up in the environment chain it doesn't get collection is going up in the environment chain it doesn't get
confused */ confused */
EX = NULL; EX = NULL;
/* always have an empty slots for people to use */
CurSlot = 0;
Yap_StartSlots();
// sl = Yap_InitSlot(t); // sl = Yap_InitSlot(t);
YENV = ASP; YENV = ASP;
YENV[E_CP] = (CELL)P; YENV[E_CP] = (CELL)P;
@ -1054,9 +1059,9 @@ init_stack(int arity, CELL *pt, int top, choiceptr saved_b)
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
WPP = NULL; WPP = NULL;
#endif #endif
YENV[E_CB] = Unsigned (B); /* start with some slots so that we can use them */
CP = YESCODE;
Yap_StartSlots(); Yap_StartSlots();
CP = YESCODE;
} }
static Term static Term