protect from looking at unused fields

This commit is contained in:
Vítor Santos Costa II 2010-04-10 21:19:31 +01:00
parent 37bf70fde1
commit 0df80db205

View File

@ -21,13 +21,13 @@
sg_fr_ptr sg_fr = (sg_fr_ptr) TrailVal(pt1); sg_fr_ptr sg_fr = (sg_fr_ptr) TrailVal(pt1);
SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use --> compiled */ SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use --> compiled */
insert_into_global_sg_fr_list(sg_fr); insert_into_global_sg_fr_list(sg_fr);
} else } else
#endif /* LIMIT_TABLING */ #endif /* LIMIT_TABLING */
if (IN_BETWEEN(Yap_TrailBase, pt, Yap_TrailTop)) { if (IN_BETWEEN(Yap_TrailBase, pt, Yap_TrailTop)) {
/* skip, this is a problem because we lose information, /* skip, this is a problem because we lose information,
namely active references */ namely active references */
pt1 = (tr_fr_ptr)pt; pt1 = (tr_fr_ptr)pt;
} else if (IsAttVar(pt)) { } else if (IN_BETWEEN(H0,pt,H) && IsAttVar(pt)) {
CELL val = Deref(*pt); CELL val = Deref(*pt);
if (IsVarTerm(val)) { if (IsVarTerm(val)) {
Bind(pt, MkAtomTerm(AtomCut)); Bind(pt, MkAtomTerm(AtomCut));
@ -130,7 +130,7 @@
} else if (IsPairTerm(d1)) { } else if (IsPairTerm(d1)) {
CELL *pt = RepPair(d1); CELL *pt = RepPair(d1);
if (IsAttVar(pt)) { if (IN_BETWEEN(H0,pt,H) && IsAttVar(pt)) {
CELL val = Deref(*pt); CELL val = Deref(*pt);
if (IsVarTerm(val)) { if (IsVarTerm(val)) {
Bind(VarOfTerm(val), MkAtomTerm(AtomCut)); Bind(VarOfTerm(val), MkAtomTerm(AtomCut));