fix case where rheap thought a fact could actually stre its src
This commit is contained in:
parent
675befae75
commit
7cc9d2f882
4
C/agc.c
4
C/agc.c
@ -34,7 +34,7 @@ static char SccsId[] = "@(#)agc.c 1.3 3/15/90";
|
|||||||
|
|
||||||
static void RestoreEntries(PropEntry *, int USES_REGS);
|
static void RestoreEntries(PropEntry *, int USES_REGS);
|
||||||
static void CleanCode(PredEntry * USES_REGS);
|
static void CleanCode(PredEntry * USES_REGS);
|
||||||
static void RestoreDBTerm(DBTerm *dbr, int attachments USES_REGS);
|
static void RestoreDBTerm(DBTerm *dbr, bool src, int attachments USES_REGS);
|
||||||
|
|
||||||
#define AtomMarkedBit 1
|
#define AtomMarkedBit 1
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ AdjustTermFlag(flag_term *tarr, UInt i)
|
|||||||
{
|
{
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
if (IsVarTerm(tarr[i].at)) {
|
if (IsVarTerm(tarr[i].at)) {
|
||||||
RestoreDBTerm( tarr[i].DBT, 0 PASS_REGS );
|
RestoreDBTerm( tarr[i].DBT, false, 0 PASS_REGS );
|
||||||
} else if (IsAtomTerm( tarr[i].at ) )
|
} else if (IsAtomTerm( tarr[i].at ) )
|
||||||
tarr[i].at = AtomTermAdjust(tarr[i].at);
|
tarr[i].at = AtomTermAdjust(tarr[i].at);
|
||||||
}
|
}
|
||||||
|
6
C/save.c
6
C/save.c
@ -114,8 +114,8 @@ static int CopyStacks( CACHE_TYPE1 );
|
|||||||
static int get_coded(int, OPCODE [] CACHE_TYPE);
|
static int get_coded(int, OPCODE [] CACHE_TYPE);
|
||||||
static void restore_codes(void);
|
static void restore_codes(void);
|
||||||
static void RestoreDB(DBEntry * CACHE_TYPE);
|
static void RestoreDB(DBEntry * CACHE_TYPE);
|
||||||
static void RestoreDBTerm(DBTerm *, int CACHE_TYPE);
|
static void RestoreDBTerm(DBTerm *, bool, int CACHE_TYPE);
|
||||||
static void CleanClauses(yamop *, yamop *,PredEntry * CACHE_TYPE);
|
static void CleanClauses(yamop *First, yamop *Last, PredEntry *pp USES_REGS);
|
||||||
static void rehash(CELL *, int, int CACHE_TYPE);
|
static void rehash(CELL *, int, int CACHE_TYPE);
|
||||||
static void CleanCode(PredEntry * CACHE_TYPE);
|
static void CleanCode(PredEntry * CACHE_TYPE);
|
||||||
static void RestoreEntries(PropEntry *, int CACHE_TYPE);
|
static void RestoreEntries(PropEntry *, int CACHE_TYPE);
|
||||||
@ -1069,7 +1069,7 @@ restore_regs(int flag USES_REGS)
|
|||||||
S = PtoGloAdjust(S);
|
S = PtoGloAdjust(S);
|
||||||
if (EX) {
|
if (EX) {
|
||||||
EX = DBTermAdjust(EX);
|
EX = DBTermAdjust(EX);
|
||||||
RestoreDBTerm(EX, TRUE PASS_REGS);
|
RestoreDBTerm(EX, false, TRUE PASS_REGS);
|
||||||
}
|
}
|
||||||
LOCAL_WokenGoals = AbsAppl(PtoGloAdjust(RepAppl(LOCAL_WokenGoals)));
|
LOCAL_WokenGoals = AbsAppl(PtoGloAdjust(RepAppl(LOCAL_WokenGoals)));
|
||||||
}
|
}
|
||||||
|
20
H/rheap.h
20
H/rheap.h
@ -498,7 +498,7 @@ static Term AdjustDBTerm__(Term trm, Term *p_base, Term *p_lim,
|
|||||||
return trm;
|
return trm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RestoreDBTerm(DBTerm *dbr, int attachments USES_REGS) {
|
static void RestoreDBTerm(DBTerm *dbr, bool src, int attachments USES_REGS) {
|
||||||
if (attachments) {
|
if (attachments) {
|
||||||
#ifdef COROUTINING
|
#ifdef COROUTINING
|
||||||
if (attachments == 1 && dbr->ag.attachments)
|
if (attachments == 1 && dbr->ag.attachments)
|
||||||
@ -540,9 +540,9 @@ static void RestoreStaticClause(StaticClause *cl USES_REGS)
|
|||||||
* clause for this predicate or not
|
* clause for this predicate or not
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
if (cl->ClFlags & SrcMask) {
|
if (cl->ClFlags & SrcMask && !(cl->ClFlags & FactMask)) {
|
||||||
cl->usc.ClSource = DBTermAdjust(cl->usc.ClSource);
|
cl->usc.ClSource = DBTermAdjust(cl->usc.ClSource);
|
||||||
RestoreDBTerm(cl->usc.ClSource, 2 PASS_REGS);
|
RestoreDBTerm(cl->usc.ClSource, true, 2 PASS_REGS);
|
||||||
}
|
}
|
||||||
if (cl->ClNext) {
|
if (cl->ClNext) {
|
||||||
cl->ClNext = PtoStCAdjust(cl->ClNext);
|
cl->ClNext = PtoStCAdjust(cl->ClNext);
|
||||||
@ -611,7 +611,7 @@ static void RestoreLUClause(LogUpdClause *cl, PredEntry *pp USES_REGS)
|
|||||||
}
|
}
|
||||||
if (!(cl->ClFlags & FactMask)) {
|
if (!(cl->ClFlags & FactMask)) {
|
||||||
cl->lusl.ClSource = DBTermAdjust(cl->lusl.ClSource);
|
cl->lusl.ClSource = DBTermAdjust(cl->lusl.ClSource);
|
||||||
RestoreDBTerm(cl->lusl.ClSource, 2 PASS_REGS);
|
RestoreDBTerm(cl->lusl.ClSource, true, 2 PASS_REGS);
|
||||||
}
|
}
|
||||||
if (cl->ClPrev) {
|
if (cl->ClPrev) {
|
||||||
cl->ClPrev = PtoLUCAdjust(cl->ClPrev);
|
cl->ClPrev = PtoLUCAdjust(cl->ClPrev);
|
||||||
@ -635,7 +635,7 @@ static void RestoreDBTermEntry(struct dbterm_list *dbl USES_REGS) {
|
|||||||
dbl->next_dbl = PtoDBTLAdjust(dbl->next_dbl);
|
dbl->next_dbl = PtoDBTLAdjust(dbl->next_dbl);
|
||||||
dbl->p = PredEntryAdjust(dbl->p);
|
dbl->p = PredEntryAdjust(dbl->p);
|
||||||
while (dbt) {
|
while (dbt) {
|
||||||
RestoreDBTerm(dbt, 0 PASS_REGS);
|
RestoreDBTerm(dbt, false, 0 PASS_REGS);
|
||||||
dbt = dbt->ag.NextDBT;
|
dbt = dbt->ag.NextDBT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -943,7 +943,7 @@ static void RestoreYapRecords__(USES_REGS1) {
|
|||||||
ptr->next_rec = DBRecordAdjust(ptr->next_rec);
|
ptr->next_rec = DBRecordAdjust(ptr->next_rec);
|
||||||
ptr->prev_rec = DBRecordAdjust(ptr->prev_rec);
|
ptr->prev_rec = DBRecordAdjust(ptr->prev_rec);
|
||||||
ptr->dbrecord = DBTermAdjust(ptr->dbrecord);
|
ptr->dbrecord = DBTermAdjust(ptr->dbrecord);
|
||||||
RestoreDBTerm(ptr->dbrecord, 0 PASS_REGS);
|
RestoreDBTerm(ptr->dbrecord, false,0 PASS_REGS);
|
||||||
ptr = ptr->next_rec;
|
ptr = ptr->next_rec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -952,7 +952,7 @@ static void RestoreBallTerm(int wid) {
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
if (LOCAL_BallTerm) {
|
if (LOCAL_BallTerm) {
|
||||||
LOCAL_BallTerm = DBTermAdjust(LOCAL_BallTerm);
|
LOCAL_BallTerm = DBTermAdjust(LOCAL_BallTerm);
|
||||||
RestoreDBTerm(LOCAL_BallTerm, 1 PASS_REGS);
|
RestoreDBTerm(LOCAL_BallTerm, false,1 PASS_REGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,7 +984,7 @@ static void RestoreDBEntry(DBRef dbr USES_REGS) {
|
|||||||
else
|
else
|
||||||
fprintf(stderr, " a var\n");
|
fprintf(stderr, " a var\n");
|
||||||
#endif
|
#endif
|
||||||
RestoreDBTerm(&(dbr->DBT), 1 PASS_REGS);
|
RestoreDBTerm(&(dbr->DBT), true, 1 PASS_REGS);
|
||||||
if (dbr->Parent) {
|
if (dbr->Parent) {
|
||||||
dbr->Parent = (DBProp)AddrAdjust((ADDR)(dbr->Parent));
|
dbr->Parent = (DBProp)AddrAdjust((ADDR)(dbr->Parent));
|
||||||
}
|
}
|
||||||
@ -1191,7 +1191,7 @@ static void restore_static_array(StaticArrayEntry *ae USES_REGS) {
|
|||||||
} else {
|
} else {
|
||||||
DBTerm *db = (DBTerm *)RepAppl(reg);
|
DBTerm *db = (DBTerm *)RepAppl(reg);
|
||||||
db = DBTermAdjust(db);
|
db = DBTermAdjust(db);
|
||||||
RestoreDBTerm(db, 1 PASS_REGS);
|
RestoreDBTerm(db, false, 1 PASS_REGS);
|
||||||
base->tstore = AbsAppl((CELL *)db);
|
base->tstore = AbsAppl((CELL *)db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1209,7 +1209,7 @@ static void restore_static_array(StaticArrayEntry *ae USES_REGS) {
|
|||||||
base++;
|
base++;
|
||||||
} else {
|
} else {
|
||||||
*base++ = reg = DBTermAdjust(reg);
|
*base++ = reg = DBTermAdjust(reg);
|
||||||
RestoreDBTerm(reg, 1 PASS_REGS);
|
RestoreDBTerm(reg, false, 1 PASS_REGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user