From 92d26f604e8b3e9badb3e75f5a95c4a37308a698 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 3 Apr 2008 10:50:28 +0000 Subject: [PATCH] term_variables could store local variable in global. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2199 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/absmi.c | 7 ++++++- C/utilpreds.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index 414d27c89..1af19d6e4 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,11 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2008-03-26 14:37:07 $,$Author: vsc $ * +* Last rev: $Date: 2008-04-03 10:50:23 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.237 2008/03/26 14:37:07 vsc +* more icc fixes +* * Revision 1.236 2008/03/25 16:45:52 vsc * make or-parallelism compile again * @@ -2220,7 +2223,9 @@ Yap_absmi(int inp) } else if ((*pt & (LogUpdMask|IndexMask)) == (LogUpdMask|IndexMask)) { LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt); int erase; +#if defined(THREADS) || defined(YAPOR) PredEntry *ap = cl->ClPred; +#endif LOCK(ap->PELock); DEC_CLREF_COUNT(cl); diff --git a/C/utilpreds.c b/C/utilpreds.c index 57e4b41c0..e32f4eede 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -742,7 +742,11 @@ p_term_variables(void) /* variables in term t */ do { Term t = Deref(ARG1); if (IsVarTerm(t)) { - return Yap_unify(MkPairTerm(t,TermNil), ARG2); + Term out = Yap_MkNewPairTerm(); + return + Yap_unify(t,HeadOfTerm(out)) && + Yap_unify(TermNil, TailOfTerm(out)) && + Yap_unify(out, ARG2); } else if (IsPrimitiveTerm(t)) { return Yap_unify(TermNil, ARG2); } else if (IsPairTerm(t)) { @@ -771,7 +775,11 @@ p_term_variables3(void) /* variables in term t */ do { Term t = Deref(ARG1); if (IsVarTerm(t)) { - return Yap_unify(MkPairTerm(t,ARG3), ARG2); + Term out = Yap_MkNewPairTerm(); + return + Yap_unify(t,HeadOfTerm(out)) && + Yap_unify(ARG3, TailOfTerm(out)) && + Yap_unify(out, ARG2); } else if (IsPrimitiveTerm(t)) { return Yap_unify(ARG2, ARG3); } else if (IsPairTerm(t)) {