diff --git a/C/save.c b/C/save.c index a26a139aa..2bcf5271e 100755 --- a/C/save.c +++ b/C/save.c @@ -450,10 +450,18 @@ save_regs(int mode) /* Then the start of the free code */ if (putcellptr(CellPtr(FreeBlocks)) < 0) return -1; + if (putcellptr(CellPtr(AuxBase)) < 0) + return -1; if (putcellptr(AuxSp) < 0) return -1; if (putcellptr(CellPtr(AuxTop)) < 0) return -1; + if (putcellptr(CellPtr(ScratchPad.ptr)) < 0) + return -1; + if (putout(ScratchPad.sz) < 0) + return -1; + if (putout(ScratchPad.msz) < 0) + return -1; if (mode == DO_EVERYTHING) { /* put the old trail base, just in case it moves again */ if (putout(ARG1) < 0) @@ -754,12 +762,24 @@ get_heap_info(void) if (Yap_ErrorMessage) return -1; FreeBlocks = (BlockHeader *) get_cellptr(); + if (Yap_ErrorMessage) + return -1; + AuxBase = (ADDR)get_cellptr(); if (Yap_ErrorMessage) return -1; AuxSp = get_cellptr(); if (Yap_ErrorMessage) return -1; AuxTop = (ADDR)get_cellptr(); + if (Yap_ErrorMessage) + return -1; + ScratchPad.ptr = (ADDR)get_cellptr(); + if (Yap_ErrorMessage) + return -1; + ScratchPad.sz = get_cell(); + if (Yap_ErrorMessage) + return -1; + ScratchPad.msz = get_cell(); if (Yap_ErrorMessage) return -1; HDiff = Unsigned(Yap_HeapBase) - Unsigned(OldHeapBase); @@ -1184,6 +1204,7 @@ RestoreFreeSpace(void) AuxSp = PtoHeapCellAdjust(AuxSp); AuxBase = AddrAdjust(AuxBase); AuxTop = AddrAdjust(AuxTop); + ScratchPad.ptr = AddrAdjust(ScratchPad.ptr); } } #else