EX changes
This commit is contained in:
parent
07907f1839
commit
5cd55b0e0e
@ -2839,7 +2839,7 @@ YAP_ThreadSelf(void)
|
||||
#if THREADS
|
||||
return Yap_thread_self();
|
||||
#else
|
||||
return NULL;
|
||||
return -2;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
11
C/save.c
11
C/save.c
@ -110,6 +110,7 @@ STATIC_PROTO(int get_coded, (int, OPCODE []));
|
||||
STATIC_PROTO(void restore_codes, (void));
|
||||
STATIC_PROTO(Term AdjustDBTerm, (Term, Term *));
|
||||
STATIC_PROTO(void RestoreDB, (DBEntry *));
|
||||
STATIC_PROTO(void RestoreDBTerm, (DBTerm *, int));
|
||||
STATIC_PROTO(void CleanClauses, (yamop *, yamop *,PredEntry *));
|
||||
STATIC_PROTO(void rehash, (CELL *, int, int));
|
||||
STATIC_PROTO(void CleanCode, (PredEntry *));
|
||||
@ -404,7 +405,7 @@ save_regs(int mode)
|
||||
return -1;
|
||||
if (putout(CreepFlag) < 0)
|
||||
return -1;
|
||||
if (putout(EX) < 0)
|
||||
if (putcellptr((CELL *)EX) < 0)
|
||||
return -1;
|
||||
#if defined(SBA) || defined(TABLING)
|
||||
if (putcellptr(H_FZ) < 0)
|
||||
@ -841,7 +842,7 @@ get_regs(int flag)
|
||||
CreepFlag = get_cell();
|
||||
if (Yap_ErrorMessage)
|
||||
return -1;
|
||||
EX = get_cell();
|
||||
EX = (struct DB_TERM *)get_cellptr();
|
||||
if (Yap_ErrorMessage)
|
||||
return -1;
|
||||
#if defined(SBA) || defined(TABLING)
|
||||
@ -1046,8 +1047,10 @@ restore_regs(int flag)
|
||||
HB = PtoLocAdjust(HB);
|
||||
YENV = PtoLocAdjust(YENV);
|
||||
S = PtoGloAdjust(S);
|
||||
if (EX)
|
||||
EX = AbsAppl(PtoGloAdjust(RepAppl(EX)));
|
||||
if (EX) {
|
||||
EX = DBTermAdjust(EX);
|
||||
RestoreDBTerm(EX, TRUE);
|
||||
}
|
||||
WokenGoals = AbsAppl(PtoGloAdjust(RepAppl(WokenGoals)));
|
||||
}
|
||||
}
|
||||
|
16
C/write.c
16
C/write.c
@ -656,7 +656,7 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
putAtom(Atom3Dots, wglb->Quote_illegal, wglb->writewch);
|
||||
return;
|
||||
}
|
||||
if (EX != 0)
|
||||
if (EX)
|
||||
return;
|
||||
t = Deref(t);
|
||||
if (IsVarTerm(t)) {
|
||||
@ -668,17 +668,17 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
} else if (IsPairTerm(t)) {
|
||||
if (wglb->Use_portray) {
|
||||
Term targs[1];
|
||||
Term old_EX = 0L;
|
||||
struct DB_TERM *old_EX = NULL;
|
||||
Int sl = 0;
|
||||
|
||||
targs[0] = t;
|
||||
Yap_PutValue(AtomPortray, MkAtomTerm(AtomNil));
|
||||
if (EX != 0L) old_EX = EX;
|
||||
if (EX) old_EX = EX;
|
||||
sl = Yap_InitSlot(t);
|
||||
Yap_execute_goal(Yap_MkApplTerm(FunctorPortray, 1, targs), 0, 1);
|
||||
t = Yap_GetFromSlot(sl);
|
||||
Yap_RecoverSlots(1);
|
||||
if (old_EX != 0L) EX = old_EX;
|
||||
if (old_EX != NULL) EX = old_EX;
|
||||
if (Yap_GetValue(AtomPortray) == MkAtomTerm(AtomTrue))
|
||||
return;
|
||||
}
|
||||
@ -760,18 +760,18 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
|
||||
#endif
|
||||
if (wglb->Use_portray) {
|
||||
Term targs[1];
|
||||
Term old_EX = 0L;
|
||||
struct DB_TERM *old_EX = NULL;
|
||||
Int sl = 0;
|
||||
|
||||
targs[0] = t;
|
||||
Yap_PutValue(AtomPortray, MkAtomTerm(AtomNil));
|
||||
if (EX != 0L) old_EX = EX;
|
||||
if (EX) old_EX = EX;
|
||||
sl = Yap_InitSlot(t);
|
||||
Yap_execute_goal(Yap_MkApplTerm(FunctorPortray, 1, targs),0, 1);
|
||||
t = Yap_GetFromSlot(sl);
|
||||
Yap_RecoverSlots(1);
|
||||
if (old_EX != 0L) EX = old_EX;
|
||||
if (Yap_GetValue(AtomPortray) == MkAtomTerm(AtomTrue) || EX != 0L)
|
||||
if (old_EX) EX = old_EX;
|
||||
if (Yap_GetValue(AtomPortray) == MkAtomTerm(AtomTrue) || EX)
|
||||
return;
|
||||
}
|
||||
if (!wglb->Ignore_ops &&
|
||||
|
Reference in New Issue
Block a user