From 16d0f2e749ec976eed1660075822e39a151691d1 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 19 Aug 2008 13:33:45 +0000 Subject: [PATCH] fix TopLevelGoal to handle correctly undefined predicates. Make sure that undefined predicated will not force the boot process to loop. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2310 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/absmi.c | 3 ++- C/exec.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index 41c384c98..1e289e806 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -7812,7 +7812,8 @@ Yap_absmi(int inp) PredEntry *pe = PredFromDefCode(PREG); BEGD(d0); /* avoid trouble with undefined dynamic procedures */ - if (pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag|MultiFileFlag)) { + if ((pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag|MultiFileFlag)) || + (UndefCode->OpcodeOfPred == UNDEF_OPCODE)) { #if defined(YAPOR) || defined(THREADS) PP = NULL; #endif diff --git a/C/exec.c b/C/exec.c index be4e6fe52..9ae77c799 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1685,7 +1685,7 @@ Yap_RunTopGoal(Term t) /* I cannot use the standard macro here because otherwise I would dereference the argument and might skip a svar */ - pe = Yap_GetPredPropByFunc(f, CurrentModule); + pe = PredPropByFunc(f, CurrentModule); pt = RepAppl(t)+1; arity = ArityOfFunctor(f); } else {