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 {