From 6a7e584e949e6f5cfb49c445e922133b30c51f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 25 Feb 2010 17:52:11 +0000 Subject: [PATCH] protect better call --- C/exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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);