fix bug in term_variables/3 with difference lists

This commit is contained in:
Vitor Santos Costa 2013-08-08 14:12:29 -05:00
parent 2c769767a4
commit 2829696db7

View File

@ -1825,7 +1825,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
Term t2 = Deref(inp);
if (IsVarTerm(t2)) {
RESET_VARIABLE(H-1);
Yap_unify((CELL)(H-1),ARG2);
Yap_unify((CELL)(H-1),inp);
} else {
H[-1] = t2; /* don't need to trail */
}
@ -2140,7 +2140,7 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
Term t2 = Deref(inp);
if (IsVarTerm(t2)) {
RESET_VARIABLE(H-1);
Yap_unify((CELL)(H-1),ARG2);
Yap_unify((CELL)(H-1), t2);
} else {
H[-1] = t2; /* don't need to trail */
}