diff --git a/C/exec.c b/C/exec.c index 3f84f6338..c9de95784 100644 --- a/C/exec.c +++ b/C/exec.c @@ -729,8 +729,14 @@ p_execute_nonstop(void) Prop pe; restart_exec: + if (IsVarTerm(mod)) { + mod = CurrentModule; + } else if (!IsAtomTerm(mod)) { + Yap_Error(TYPE_ERROR_ATOM, ARG2, "call/1"); + return FALSE; + } if (IsVarTerm(t)) { - Yap_Error(INSTANTIATION_ERROR,ARG3,"call/1"); + Yap_Error(INSTANTIATION_ERROR,ARG1,"call/1"); return FALSE; } else if (IsAtomTerm(t)) { Atom a = AtomOfTerm(t);