make sure to reset state after error.
This commit is contained in:
parent
a837a303d4
commit
bf0844a2a0
@ -687,12 +687,13 @@ p_exp(Term t1, Term t2 USES_REGS)
|
|||||||
{
|
{
|
||||||
Int i1 = IntegerOfTerm(t1);
|
Int i1 = IntegerOfTerm(t1);
|
||||||
Int i2 = IntegerOfTerm(t2);
|
Int i2 = IntegerOfTerm(t2);
|
||||||
Int pow = ipow(i1,i2);
|
Int pow;
|
||||||
|
|
||||||
if (i2 < 0) {
|
if (i2 < 0) {
|
||||||
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t2,
|
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t2,
|
||||||
"%d ^ %d", i1, i2);
|
"%d ^ %d", i1, i2);
|
||||||
}
|
}
|
||||||
|
pow = ipow(i1,i2);
|
||||||
#ifdef USE_GMP
|
#ifdef USE_GMP
|
||||||
/* two integers */
|
/* two integers */
|
||||||
if ((i1 && !pow)) {
|
if ((i1 && !pow)) {
|
||||||
|
1
C/eval.c
1
C/eval.c
@ -437,6 +437,7 @@ Yap_EvalError(yap_error_number type, Term where, char *format,...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
if (LOCAL_ArithError) {
|
if (LOCAL_ArithError) {
|
||||||
|
LOCAL_ArithError = YAP_NO_ERROR;
|
||||||
return Yap_Error( LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage);
|
return Yap_Error( LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user