bug in dbref arrays with log updates

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1148 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-09-28 18:37:05 +00:00
parent 40a39a79b1
commit 6e0defe923
2 changed files with 9 additions and 4 deletions

View File

@ -12,7 +12,7 @@
* Last rev: * * Last rev: *
* mods: * * mods: *
* comments: allocating space * * comments: allocating space *
* version:$Id: alloc.c,v 1.58 2004-09-27 20:45:02 vsc Exp $ * * version:$Id: alloc.c,v 1.59 2004-09-28 18:37:05 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#ifdef SCCS #ifdef SCCS
static char SccsId[] = "%W% %G%"; static char SccsId[] = "%W% %G%";
@ -308,6 +308,8 @@ AddToFreeList(BlockHeader *b)
*q = b; *q = b;
} }
static int vsc_count_b;
static void static void
FreeBlock(BlockHeader *b) FreeBlock(BlockHeader *b)
{ {
@ -324,7 +326,8 @@ FreeBlock(BlockHeader *b)
/* sanity check */ /* sanity check */
sp = &(b->b_size) + (b->b_size & ~InUseFlag); sp = &(b->b_size) + (b->b_size & ~InUseFlag);
if (*sp != b->b_size) { if (b == 0x8a04428) vsc_count_b++;
if (!(b->b_size & InUseFlag) || *sp != b->b_size) {
#if !SHORT_INTS #if !SHORT_INTS
fprintf(stderr, "%% YAP INTERNAL ERROR: sanity check failed in FreeBlock %p %x %x\n", fprintf(stderr, "%% YAP INTERNAL ERROR: sanity check failed in FreeBlock %p %x %x\n",
b, b->b_size, Unsigned(*sp)); b, b->b_size, Unsigned(*sp));

View File

@ -243,8 +243,10 @@ AccessNamedArray(Atom a, Int indx)
if (ref->Flags & LogUpdMask) { if (ref->Flags & LogUpdMask) {
LogUpdClause *cl = (LogUpdClause *)ref; LogUpdClause *cl = (LogUpdClause *)ref;
cl->ClFlags |= InUseMask; if (!(cl->ClFlags & InUseMask)) {
TRAIL_CLREF(cl); cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
} else { } else {
if (!(ref->Flags & InUseMask)) { if (!(ref->Flags & InUseMask)) {
ref->Flags |= InUseMask; ref->Flags |= InUseMask;