diff --git a/C/dbase.c b/C/dbase.c index 7ad9669a2..65b1e0d1b 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -4631,6 +4631,7 @@ p_instance(void) if (IsVarTerm(t2)) { Yap_unify(ARG2, (t2 = Yap_MkNewApplTerm(f,arity))); } else if (!IsApplTerm(t2) || FunctorOfTerm(t2) != f) { + UNLOCK(ap->PELock); return FALSE; } ptr = RepAppl(t2)+1;