diff --git a/C/absmi.c b/C/absmi.c index 834d63127..901e984dc 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -12272,7 +12272,11 @@ Yap_absmi(int inp) d1 = IntegerOfTerm(d1); else { saveregs(); - Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + if (IsBigIntTerm(d1)) { + Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3"); + } else { + Yap_Error(TYPE_ERROR_INTEGER, d1, "functor/3"); + } setregs(); FAIL(); } @@ -12392,7 +12396,11 @@ Yap_absmi(int inp) d1 = IntegerOfTerm(d1); else { saveregs(); - Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + if (IsBigIntTerm(d1)) { + Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3"); + } else { + Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + } setregs(); FAIL(); } @@ -12598,7 +12606,11 @@ Yap_absmi(int inp) d1 = IntegerOfTerm(d1); else { saveregs(); - Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + if (IsBigIntTerm(d1)) { + Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3"); + } else { + Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + } setregs(); FAIL(); } @@ -12736,7 +12748,11 @@ Yap_absmi(int inp) d1 = IntegerOfTerm(d1); } else { saveregs(); - Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + if (IsBigIntTerm(d1)) { + Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3"); + } else { + Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3"); + } setregs(); FAIL(); } @@ -13321,7 +13337,7 @@ Yap_absmi(int inp) } else { setregs(); } - goto restart_functor; + goto restart_functor; /* */ } while ((Int)d1--) { RESET_VARIABLE(pt1); diff --git a/C/inlines.c b/C/inlines.c index 369b6d820..d7efa8b38 100755 --- a/C/inlines.c +++ b/C/inlines.c @@ -678,10 +678,14 @@ p_functor(void) /* functor(?,?,?) */ deref_head(d1, func_var_3unk); func_var_3nvar: /* Uuuff, the second and third argument are bound */ - if (IsIntTerm(d1)) + if (IsIntegerTerm(d1)) d1 = IntOfTerm(d1); else { - Yap_Error(TYPE_ERROR_INTEGER,ARG3,"functor/3"); + if (IsBigIntTerm(d1)) { + Yap_Error(RESOURCE_ERROR_STACK, ARG3, "functor/3"); + } else { + Yap_Error(TYPE_ERROR_INTEGER,ARG3,"functor/3"); + } return(FALSE); } if (!IsAtomicTerm(d0)) {