fix syntax error: tokens might be overwritten by Yap_unify(
This commit is contained in:
parent
4b35fd8271
commit
f753bce4fe
@ -271,13 +271,11 @@ syntax_error (TokEntry * tokptr, IOSTREAM *st, Term *outp)
|
|||||||
CELL *Hi = H;
|
CELL *Hi = H;
|
||||||
|
|
||||||
/* make sure to globalise variable */
|
/* make sure to globalise variable */
|
||||||
Yap_unify(*outp, MkVarTerm());
|
|
||||||
start = tokptr->TokPos;
|
start = tokptr->TokPos;
|
||||||
clean_vars(LOCAL_VarTable);
|
clean_vars(LOCAL_VarTable);
|
||||||
clean_vars(LOCAL_AnonVarTable);
|
clean_vars(LOCAL_AnonVarTable);
|
||||||
while (1) {
|
while (1) {
|
||||||
Term ts[2];
|
Term ts[2];
|
||||||
|
|
||||||
if (H > ASP-1024) {
|
if (H > ASP-1024) {
|
||||||
tf[3] = TermNil;
|
tf[3] = TermNil;
|
||||||
err = 0;
|
err = 0;
|
||||||
@ -357,6 +355,8 @@ syntax_error (TokEntry * tokptr, IOSTREAM *st, Term *outp)
|
|||||||
}
|
}
|
||||||
tokptr = tokptr->TokNext;
|
tokptr = tokptr->TokNext;
|
||||||
}
|
}
|
||||||
|
/* now we can throw away tokens, so we can unify and possibly overwrite TR */
|
||||||
|
Yap_unify(*outp, MkVarTerm());
|
||||||
if (IsVarTerm(*outp) && (VarOfTerm(*outp) > H || VarOfTerm(*outp) < H0)) {
|
if (IsVarTerm(*outp) && (VarOfTerm(*outp) > H || VarOfTerm(*outp) < H0)) {
|
||||||
tf[0] = Yap_MkNewApplTerm(Yap_MkFunctor(AtomRead,1),1);
|
tf[0] = Yap_MkNewApplTerm(Yap_MkFunctor(AtomRead,1),1);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user