From a154a3f6e8a41bd23e6e2a2402cdbb8662c009b9 Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 14 Aug 2003 11:59:26 +0000 Subject: [PATCH] fix setarg(0,T,_). git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@853 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/mavar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C/mavar.c b/C/mavar.c index d50e1960c..215249250 100644 --- a/C/mavar.c +++ b/C/mavar.c @@ -58,10 +58,13 @@ p_setarg(void) Yap_Error(TYPE_ERROR_COMPOUND,ts,"setarg/3"); return(FALSE); } - if (i < 0 || i > (Int)ArityOfFunctor(FunctorOfTerm(ts))) { + if (i < 1 || i > (Int)ArityOfFunctor(FunctorOfTerm(ts))) { if (i<0) Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,ts,"setarg/3"); return(FALSE); + if (i==0) + Yap_Error(DOMAIN_ERROR_NOT_ZERO,ts,"setarg/3"); + return(FALSE); } pt = RepAppl(ts)+i; /* the evil deed is to be done now */