fix copy term when the same constrained term appears several times.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@455 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
376d26f93f
commit
b63425bf5c
@ -61,6 +61,9 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H
|
|||||||
CELL **to_visit = (CELL **)(HeapTop + sizeof(CELL));
|
CELL **to_visit = (CELL **)(HeapTop + sizeof(CELL));
|
||||||
tr_fr_ptr TR0 = TR;
|
tr_fr_ptr TR0 = TR;
|
||||||
CELL *HB0 = HB;
|
CELL *HB0 = HB;
|
||||||
|
#ifdef COROUTINING
|
||||||
|
CELL *dvars = NULL;
|
||||||
|
#endif
|
||||||
HB = HLow;
|
HB = HLow;
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
@ -182,9 +185,13 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H
|
|||||||
/* if unbound, call the standard copy term routine */
|
/* if unbound, call the standard copy term routine */
|
||||||
CELL **bp[1];
|
CELL **bp[1];
|
||||||
tr_fr_ptr CurTR;
|
tr_fr_ptr CurTR;
|
||||||
|
if (ptd0 >= dvars) {
|
||||||
|
*ptf++ = (CELL) ptd0;
|
||||||
|
} else {
|
||||||
|
if (dvars == NULL) {
|
||||||
|
dvars = (CELL *)ReadTimedVar(DelayedVars);
|
||||||
|
}
|
||||||
bp[0] = to_visit;
|
bp[0] = to_visit;
|
||||||
Bind_Global(ptd0,(CELL)ptf);
|
|
||||||
CurTR = TR;
|
CurTR = TR;
|
||||||
HB = HB0;
|
HB = HB0;
|
||||||
if (!attas[ExtFromCell(ptd0)].copy_term_op(ptd0, bp, ptf)) {
|
if (!attas[ExtFromCell(ptd0)].copy_term_op(ptd0, bp, ptf)) {
|
||||||
@ -192,7 +199,6 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H
|
|||||||
}
|
}
|
||||||
to_visit = bp[0];
|
to_visit = bp[0];
|
||||||
HB = HLow;
|
HB = HLow;
|
||||||
ptf++;
|
|
||||||
if (CurTR != TR) {
|
if (CurTR != TR) {
|
||||||
/* Problem here is that the attached routine might
|
/* Problem here is that the attached routine might
|
||||||
* have changed the list of suspended goals and stored
|
* have changed the list of suspended goals and stored
|
||||||
@ -213,6 +219,9 @@ copy_complex_term(register CELL *pt0, register CELL *pt0_end, CELL *ptf, CELL *H
|
|||||||
}
|
}
|
||||||
TR0 = (tr_fr_ptr)pt1;
|
TR0 = (tr_fr_ptr)pt1;
|
||||||
}
|
}
|
||||||
|
ptf++;
|
||||||
|
Bind_Global(ptd0, ptf[-1]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
/* first time we met this term */
|
/* first time we met this term */
|
||||||
|
Reference in New Issue
Block a user