From 028c3a03f2daccc7d5b5ea99989dc6f016e603f7 Mon Sep 17 00:00:00 2001 From: ccremers Date: Tue, 10 Aug 2004 11:26:14 +0000 Subject: [PATCH] - Bugfix. --- src/mgu.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/mgu.c b/src/mgu.c index be6fc89..2e83201 100644 --- a/src/mgu.c +++ b/src/mgu.c @@ -179,10 +179,13 @@ termMguInTerm (Term t1, Term t2, void (*iterator) ()) } // simple clause or combined tl = termMguTerm (t1, t2); - // Iterate - iterator (); - // Reset variables - termlistSubstReset (tl); + if (tl != MGUFAIL) + { + // Iterate + iterator (); + // Reset variables + termlistSubstReset (tl); + } } //! Most general subterm unifiers of t1 subterm t2 @@ -224,8 +227,11 @@ termMguSubTerm (Term t1, Term t2, void (*iterator) (), } // simple clause or combined tl = termMguTerm (t1, t2); - // Iterate - iterator (keylist); - // Reset variables - termlistSubstReset (tl); + if (tl != MGUFAIL) + { + // Iterate + iterator (keylist); + // Reset variables + termlistSubstReset (tl); + } }