new error handlong mechanism

new YAP_ foreign interface
fix unbound_first_arg in call_with_args


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@582 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-09-09 17:40:12 +00:00
parent 708437b794
commit 21aab28a59
40 changed files with 1799 additions and 2383 deletions

View File

@@ -1250,36 +1250,48 @@ exec_absmi(int top)
{
int lval;
if (top && (lval = sigsetjmp (RestartEnv, 1)) != 0) {
if (lval == 1) { /* restart */
/* otherwise, SetDBForThrow will fail entering critical mode */
PrologMode = UserMode;
/* find out where to cut to */
switch(lval) {
case 1:
{ /* restart */
/* otherwise, SetDBForThrow will fail entering critical mode */
PrologMode = UserMode;
/* find out where to cut to */
#if defined(__GNUC__)
#if defined(hppa) || defined(__alpha)
/* siglongjmp resets the TR hardware register */
restore_TR();
/* siglongjmp resets the TR hardware register */
restore_TR();
#endif
#if defined(__alpha)
/* siglongjmp resets the H hardware register */
restore_H();
/* siglongjmp resets the H hardware register */
restore_H();
#endif
#endif
yap_flags[SPY_CREEP_FLAG] = 0;
CreepFlag = CalculateStackGap();
P = (yamop *)FAILCODE;
}
if (lval == 2) { /* arithmetic exception */
/* must be done here, otherwise siglongjmp will clobber all the registers */
Error(YAP_matherror,TermNil,NULL);
/* reset the registers so that we don't have trash in abstract machine */
set_fpu_exceptions(yap_flags[LANGUAGE_MODE_FLAG] == 1);
P = (yamop *)FAILCODE;
}
if (lval == 3) { /* saved state */
return(FALSE);
yap_flags[SPY_CREEP_FLAG] = 0;
CreepFlag = CalculateStackGap();
P = (yamop *)FAILCODE;
PrologMode = UserMode;
}
break;
case 2:
{
/* arithmetic exception */
/* must be done here, otherwise siglongjmp will clobber all the registers */
Error(YAP_matherror,TermNil,NULL);
/* reset the registers so that we don't have trash in abstract machine */
set_fpu_exceptions(yap_flags[LANGUAGE_MODE_FLAG] == 1);
P = (yamop *)FAILCODE;
PrologMode = UserMode;
}
break;
case 3:
{ /* saved state */
return(FALSE);
}
default:
/* do nothing */
PrologMode = UserMode;
}
}
PrologMode = UserMode;
return(absmi(0));
}