improve error handling in arithmetic comparison (obs from Jose Santos)

This commit is contained in:
Vitor Santos Costa
2009-07-08 10:32:14 -05:00
parent 02e82d7719
commit 6e3830aa4b
3 changed files with 49 additions and 8 deletions

View File

@@ -40,6 +40,7 @@ static Term
Eval(Term t)
{
if (IsVarTerm(t)) {
ArithError = TRUE;
return Yap_ArithError(INSTANTIATION_ERROR,t,"in arithmetic");
} else if (IsAtomTerm(t)) {
ExpEntry *p;
@@ -156,6 +157,7 @@ Yap_ArithError(yap_error_number type, Term where, char *format,...)
{
va_list ap;
ArithError = TRUE;
Yap_Error_TYPE = type;
Yap_Error_Term = where;
if (!Yap_ErrorMessage)