second try to fix error handling in arithmetic expressions. THis time:
- exit at predicate end; - just return first on multiple erors. - YapArithError takes care of inner errors, Yp_EvalError fixes externals. - a few ISO stuff to make Paulo's unit tests go happier.
This commit is contained in:
12
H/eval.h
12
H/eval.h
@@ -365,6 +365,7 @@ Term Yap_eval_binary(Int,Term,Term);
|
||||
|
||||
Term Yap_InnerEval__(Term USES_REGS);
|
||||
Int Yap_ArithError(yap_error_number,Term,char *msg, ...);
|
||||
yamop* Yap_EvalError(yap_error_number,Term,char *msg, ...);
|
||||
|
||||
#include "inline-only.h"
|
||||
|
||||
@@ -390,15 +391,12 @@ Yap_ClearExs(void)
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
}
|
||||
|
||||
inline static bool
|
||||
inline static yap_error_number
|
||||
Yap_FoundArithError__(USES_REGS1)
|
||||
{
|
||||
if (Yap_MathException() || LOCAL_Error_TYPE) {
|
||||
Yap_external_signal( worker_id, YAP_FPE_SIGNAL );
|
||||
regcache->P_ = FAILCODE;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (LOCAL_Error_TYPE != YAP_NO_ERROR)
|
||||
return LOCAL_Error_TYPE;
|
||||
return Yap_MathException();
|
||||
}
|
||||
|
||||
Atom Yap_NameOfUnaryOp(int i);
|
||||
|
Reference in New Issue
Block a user