From f137773011f6a7ef8ce1d6572cb2d8f0c740fd9f Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 22 Feb 2010 22:48:13 +0000 Subject: [PATCH] fix error handling on entry arguments. --- C/arith1.c | 3 ++- C/arith2.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/C/arith1.c b/C/arith1.c index 477881b60..e380451bd 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -797,8 +797,9 @@ p_unary_is(void) return FALSE; } top = Yap_Eval(Deref(ARG3)); - if (top == 0L) + if (!Yap_FoundArithError(top, ARG3)) { return FALSE; + } if (IsIntTerm(t)) { Term tout = Yap_FoundArithError(eval1(IntegerOfTerm(t), top), Deref(ARG3)); if (!tout) diff --git a/C/arith2.c b/C/arith2.c index e79ca6284..cd4db2f96 100644 --- a/C/arith2.c +++ b/C/arith2.c @@ -1117,13 +1117,15 @@ p_binary_is(void) return(FALSE); } t1 = Yap_Eval(Deref(ARG3)); - if (t1 == 0L) + if (!Yap_FoundArithError(t1, ARG3)) { return FALSE; + } t2 = Yap_Eval(Deref(ARG4)); - if (t2 == 0L) + if (!Yap_FoundArithError(t2, ARG4)) { return FALSE; + } if (IsIntTerm(t)) { - Term tout = Yap_FoundArithError(eval2(IntegerOfTerm(t), t1, t2), 0L); + Term tout = Yap_FoundArithError(eval2(IntOfTerm(t), t1, t2), 0L); if (!tout) return FALSE; return Yap_unify_constant(ARG1,tout);