A few extra fixes for saved states.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1186 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-11-23 21:16:21 +00:00
parent c083c838bb
commit bd965693e4
5 changed files with 21 additions and 8 deletions

View File

@ -1673,11 +1673,16 @@ CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat, UInt extra_size, struc
#endif #endif
ppt->Entry = AdjustIDBPtr(tt,(CELL)ppt-(CELL)ppt0); ppt->Entry = AdjustIDBPtr(tt,(CELL)ppt-(CELL)ppt0);
#ifdef COROUTINING #ifdef COROUTINING
if (ppt->attachments) if (attachments)
ppt->attachments = AdjustIDBPtr(ppt->attachments,(CELL)ppt-(CELL)ppt0); ppt->attachments = AdjustIDBPtr(attachments,(CELL)ppt-(CELL)ppt0);
else
ppt->attachments = 0L;
#endif #endif
} else { } else {
ppt->Entry = tt; ppt->Entry = tt;
#ifdef COROUTINING
ppt->attachments = attachments;
#endif
} }
if (flag & DBWithRefs) { if (flag & DBWithRefs) {
DBRef *ptr = TmpRefBase, *rfnar = (DBRef *)nar; DBRef *ptr = TmpRefBase, *rfnar = (DBRef *)nar;

View File

@ -1314,7 +1314,7 @@ RestoreHeap(OPCODE old_ops[])
CurrentModule = PROLOG_MODULE; CurrentModule = PROLOG_MODULE;
opcodes_moved = check_opcodes(old_ops); opcodes_moved = check_opcodes(old_ops);
/* opcodes_moved has side-effects and should be tried first */ /* opcodes_moved has side-effects and should be tried first */
if (heap_moved || opcodes_moved) { if (heap_moved || opcodes_moved || TRUE) {
restore_heap(); restore_heap();
} }
/* This must be done after restore_heap */ /* This must be done after restore_heap */

View File

@ -603,7 +603,6 @@ Yap_scan_num(int (*Nxtch) (int))
tsize = Yap_TrailTop-ScannerStack; tsize = Yap_TrailTop-ScannerStack;
if (tsize < 4096) { if (tsize < 4096) {
if(!Yap_growtrail (sizeof(CELL) * 16 * 1024L)) { if(!Yap_growtrail (sizeof(CELL) * 16 * 1024L)) {
printf("vsc: Hello\n");
Yap_ErrorMessage = "Trail Overflow"; Yap_ErrorMessage = "Trail Overflow";
return TermNil; return TermNil;
} }

View File

@ -605,7 +605,6 @@ InitReverseLookupOpcode(void)
for (i = _std_top; i > _Ystop; i--) { for (i = _std_top; i > _Ystop; i--) {
OPCODE opc = Yap_opcode(i); OPCODE opc = Yap_opcode(i);
int j = rtable_hash_op(opc,hash_size_mask); int j = rtable_hash_op(opc,hash_size_mask);
while (opeptr[j].opc) { while (opeptr[j].opc) {
if (++j > hash_size_mask) if (++j > hash_size_mask)
j = 0; j = 0;

View File

@ -11,8 +11,11 @@
* File: rheap.h * * File: rheap.h *
* comments: walk through heap code * * comments: walk through heap code *
* * * *
* Last rev: $Date: 2004-10-26 20:16:18 $,$Author: vsc $ * * Last rev: $Date: 2004-11-23 21:16:21 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.45 2004/10/26 20:16:18 vsc
* More bug fixes for overflow handling
*
* Revision 1.44 2004/10/06 16:55:47 vsc * Revision 1.44 2004/10/06 16:55:47 vsc
* change configure to support big mem configs * change configure to support big mem configs
* get rid of extra globals * get rid of extra globals
@ -589,8 +592,11 @@ restore_opcodes(yamop *pc)
fprintf(stderr, "%s ", op_names[op]); fprintf(stderr, "%s ", op_names[op]);
#endif #endif
switch (op) { switch (op) {
case _Ystop:
case _Nstop: case _Nstop:
Yap_Error(SYSTEM_ERROR, TermNil,
"Invalid Opcode found while restoring %p", pc);
return;
case _Ystop:
#ifdef DEBUG_RESTORE2 #ifdef DEBUG_RESTORE2
fprintf(stderr, "OK\n"); fprintf(stderr, "OK\n");
#endif #endif
@ -820,7 +826,11 @@ restore_opcodes(yamop *pc)
pc->u.sla.sla_u.mod = AtomTermAdjust(pc->u.sla.sla_u.mod); pc->u.sla.sla_u.mod = AtomTermAdjust(pc->u.sla.sla_u.mod);
} }
pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0); pc->u.sla.p0 = PtoPredAdjust(pc->u.sla.p0);
if (pc->u.sla.bmap != NULL) {
pc->u.sla.bmap = CellPtoHeapAdjust(pc->u.sla.bmap);
}
pc = NEXTOP(pc,sla); pc = NEXTOP(pc,sla);
break;
case _fcall: case _fcall:
case _call: case _call:
#ifdef YAPOR #ifdef YAPOR