diff --git a/C/dbase.c b/C/dbase.c index 8098d938b..06e28242f 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -1673,11 +1673,16 @@ CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat, UInt extra_size, struc #endif ppt->Entry = AdjustIDBPtr(tt,(CELL)ppt-(CELL)ppt0); #ifdef COROUTINING - if (ppt->attachments) - ppt->attachments = AdjustIDBPtr(ppt->attachments,(CELL)ppt-(CELL)ppt0); + if (attachments) + ppt->attachments = AdjustIDBPtr(attachments,(CELL)ppt-(CELL)ppt0); + else + ppt->attachments = 0L; #endif - } else { + } else { ppt->Entry = tt; +#ifdef COROUTINING + ppt->attachments = attachments; +#endif } if (flag & DBWithRefs) { DBRef *ptr = TmpRefBase, *rfnar = (DBRef *)nar; diff --git a/C/save.c b/C/save.c index 6fe56382f..9d9496dbf 100644 --- a/C/save.c +++ b/C/save.c @@ -1314,7 +1314,7 @@ RestoreHeap(OPCODE old_ops[]) CurrentModule = PROLOG_MODULE; opcodes_moved = check_opcodes(old_ops); /* opcodes_moved has side-effects and should be tried first */ - if (heap_moved || opcodes_moved) { + if (heap_moved || opcodes_moved || TRUE) { restore_heap(); } /* This must be done after restore_heap */ diff --git a/C/scanner.c b/C/scanner.c index 1790997ca..484f76064 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -603,7 +603,6 @@ Yap_scan_num(int (*Nxtch) (int)) tsize = Yap_TrailTop-ScannerStack; if (tsize < 4096) { if(!Yap_growtrail (sizeof(CELL) * 16 * 1024L)) { - printf("vsc: Hello\n"); Yap_ErrorMessage = "Trail Overflow"; return TermNil; } diff --git a/C/unify.c b/C/unify.c index 1e7f9e8d9..6159e8c84 100644 --- a/C/unify.c +++ b/C/unify.c @@ -605,7 +605,6 @@ InitReverseLookupOpcode(void) for (i = _std_top; i > _Ystop; i--) { OPCODE opc = Yap_opcode(i); int j = rtable_hash_op(opc,hash_size_mask); - while (opeptr[j].opc) { if (++j > hash_size_mask) j = 0; diff --git a/H/rheap.h b/H/rheap.h index 162d690da..cf4e60000 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -11,8 +11,11 @@ * File: rheap.h * * 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 $ +* 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 * change configure to support big mem configs * get rid of extra globals @@ -589,8 +592,11 @@ restore_opcodes(yamop *pc) fprintf(stderr, "%s ", op_names[op]); #endif switch (op) { - case _Ystop: case _Nstop: + Yap_Error(SYSTEM_ERROR, TermNil, + "Invalid Opcode found while restoring %p", pc); + return; + case _Ystop: #ifdef DEBUG_RESTORE2 fprintf(stderr, "OK\n"); #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.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); + break; case _fcall: case _call: #ifdef YAPOR