fix #37: give resource error if trying to create a functor with bignum arity
also, allow meta-call to create large functors > Int.
This commit is contained in:
parent
0cd72ad258
commit
e84ecf2eaf
26
C/absmi.c
26
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);
|
||||
|
@ -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)) {
|
||||
|
Reference in New Issue
Block a user