make sure to have trail entries reset on setjump (obs from Jose Santos).

This commit is contained in:
Costa Vitor 2009-07-17 19:31:20 -05:00
parent 66683aeef9
commit 869671fb1b

View File

@ -1518,6 +1518,7 @@ clean_trail(Term t, DBTerm *dbt, Term t0)
#endif #endif
/* normal variable */ /* normal variable */
RESET_VARIABLE(d1); RESET_VARIABLE(d1);
RESET_VARIABLE(&TrailTerm(pt1));
pt1--; pt1--;
} else if (IsPairTerm(d1)) { } else if (IsPairTerm(d1)) {
CELL *pt = RepPair(d1); CELL *pt = RepPair(d1);
@ -1545,10 +1546,16 @@ clean_trail(Term t, DBTerm *dbt, Term t0)
/* multi-assignment variable */ /* multi-assignment variable */
/* so the next cell is the old value */ /* so the next cell is the old value */
#ifdef FROZEN_STACKS #ifdef FROZEN_STACKS
RESET_VARIABLE(&TrailTerm(pt1));
--pt1; --pt1;
pt[0] = TrailVal(pt1); pt[0] = TrailVal(pt1);
RESET_VARIABLE(&TrailTerm(pt1));
--pt1;
#else #else
pt[0] = TrailTerm(pt1-1); pt[0] = TrailTerm(pt1-1);
RESET_VARIABLE(&TrailTerm(pt1));
RESET_VARIABLE(&TrailTerm(pt1-1));
RESET_VARIABLE(&TrailTerm(pt1-2));
pt1 -= 3; pt1 -= 3;
#endif /* FROZEN_STACKS */ #endif /* FROZEN_STACKS */
} }