diff --git a/C/agc.c b/C/agc.c index 12f692192..340c63d67 100644 --- a/C/agc.c +++ b/C/agc.c @@ -29,6 +29,7 @@ static char SccsId[] = "@(#)agc.c 1.3 3/15/90"; #endif STATIC_PROTO(void RestoreEntries, (PropEntry *)); +STATIC_PROTO(void CleanCode, (PredEntry *)); static int agc_calls; diff --git a/C/cdmgr.c b/C/cdmgr.c index ad150f5ae..0873f2f4c 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -3526,7 +3526,6 @@ Yap_InitCdMgr(void) Yap_InitCPred("$pred_exists", 2, p_pred_exists, TestPredFlag | SafePredFlag); Yap_InitCPred("$number_of_clauses", 3, p_number_of_clauses, SafePredFlag|SyncPredFlag); Yap_InitCPred("$undefined", 2, p_undefined, SafePredFlag|TestPredFlag); - fprintf(stderr,"initialised\n"); Yap_InitCPred("$optimizer_on", 0, p_optimizer_on, SafePredFlag|SyncPredFlag); Yap_InitCPred("$clean_up_dead_clauses", 0, p_clean_up_dead_clauses, SyncPredFlag); Yap_InitCPred("$optimizer_off", 0, p_optimizer_off, SafePredFlag|SyncPredFlag); diff --git a/H/rheap.h b/H/rheap.h index c1df5f86e..16f166fc0 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -148,6 +148,26 @@ restore_codes(void) } } } + if (heap_regs->IntLUKeys != NULL) { + heap_regs->IntLUKeys = (Prop *)AddrAdjust((ADDR)(heap_regs->IntLUKeys)); + { + Int i; + for (i = 0; i < INT_KEYS_SIZE; i++) { + Prop p0 = INT_LU_KEYS[i]; + if (p0) { + p0 = PropAdjust(p0); + INT_LU_KEYS[i] = p0; + while (p0) { + PredEntry *pe = RepPredProp(p0); + pe->NextOfPE = + PropAdjust(pe->NextOfPE); + CleanCode(pe); + p0 = RepProp(pe->NextOfPE); + } + } + } + } + } if (heap_regs->IntBBKeys != NULL) { heap_regs->IntBBKeys = (Prop *)AddrAdjust((ADDR)(heap_regs->IntBBKeys)); { @@ -1499,6 +1519,9 @@ CleanCode(PredEntry *pp) if (pp->src.OwnerFile && pp->ModuleOfPred != 2) pp->src.OwnerFile = AtomAdjust(pp->src.OwnerFile); } + if (!(pp->PredFlags & NumberDBPredFlag)) { + pp->src.OwnerFile = AtomAdjust(pp->src.OwnerFile); + } pp->OpcodeOfPred = Yap_opcode(Yap_op_from_opcode(pp->OpcodeOfPred)); if (pp->PredFlags & (AsmPredFlag|CPredFlag)) { /* assembly */ @@ -1522,7 +1545,7 @@ CleanCode(PredEntry *pp) FirstC = pp->cs.p_code.FirstClause; LastC = pp->cs.p_code.LastClause; /* We just have a fail here */ - if (FirstC == NIL && LastC == NIL) { + if (FirstC == NULL && LastC == NULL) { return; } #ifdef DEBUG_RESTORE2