inf depth limit

This commit is contained in:
Vitor Santos Costa 2013-01-28 23:21:54 +00:00
parent deba351b87
commit 14d4386e5a

View File

@ -1039,12 +1039,18 @@ p_execute_depth_limit( USES_REGS1 ) {
Term d = Deref(ARG2); Term d = Deref(ARG2);
if (IsVarTerm(d)) { if (IsVarTerm(d)) {
Yap_Error(INSTANTIATION_ERROR,d,"depth_bound_call/2"); Yap_Error(INSTANTIATION_ERROR,d,"depth_bound_call/2");
} else if (!IsIntTerm(d)) { return FALSE;
Yap_Error(TYPE_ERROR_INTEGER, d, "depth_bound_call/2"); } else if (!IsIntegerTerm(d)) {
return(FALSE); if (IsFloatTerm(d) && isinf(FloatOfTerm(d))) {
DEPTH = RESET_DEPTH();
} else {
Yap_Error(TYPE_ERROR_INTEGER, d, "depth_bound_call/2");
return FALSE;
}
} else {
DEPTH = MkIntTerm(IntegerOfTerm(d)*2);
} }
DEPTH = MkIntTerm(IntOfTerm(d)*2); return p_execute( PASS_REGS1 );
return(p_execute( PASS_REGS1 ));
} }
#endif #endif