fix error handling from within recursive invocations of emulator
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@427 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
b62af46858
commit
ff0b60d7a7
@ -7816,13 +7816,11 @@ absmi(int inp)
|
||||
DelayedB = pt0;
|
||||
}
|
||||
/* find where to cut to */
|
||||
#ifdef YAPOR
|
||||
if (SHOULD_CUT_UP_TO(B,pt0)) {
|
||||
/* Wow, we're gonna cut!!! */
|
||||
#ifdef YAPOR
|
||||
CUT_prune_to(pt0);
|
||||
#else
|
||||
if (SHOULD_CUT_UP_TO(B,pt0)) {
|
||||
/* Wow, we're gonna cut!!! */
|
||||
B = pt0;
|
||||
#endif /* YAPOR */
|
||||
HBREG = PROTECT_FROZEN_H(B);
|
||||
|
12
C/cdmgr.c
12
C/cdmgr.c
@ -922,15 +922,15 @@ p_in_this_f_before(void)
|
||||
Prop p0;
|
||||
SMALLUNSGN mod;
|
||||
|
||||
if (IsVarTerm(t = Deref(ARG1)) && !IsAtomTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG1)) || !IsAtomTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
at = AtomOfTerm(t);
|
||||
if (IsVarTerm(t = Deref(ARG2)) && !IsIntTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG2)) || !IsIntTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
arity = IntOfTerm(t);
|
||||
if (IsVarTerm(t = Deref(ARG3)) && !IsAtomTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG3)) || !IsAtomTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
mod = LookupModule(t);
|
||||
@ -962,15 +962,15 @@ p_first_cl_in_f(void)
|
||||
SMALLUNSGN mod;
|
||||
|
||||
|
||||
if (IsVarTerm(t = Deref(ARG1)) && !IsAtomTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG1)) || !IsAtomTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
at = AtomOfTerm(t);
|
||||
if (IsVarTerm(t = Deref(ARG2)) && !IsIntTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG2)) || !IsIntTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
arity = IntOfTerm(t);
|
||||
if (IsVarTerm(t = Deref(ARG3)) && !IsAtomTerm(t))
|
||||
if (IsVarTerm(t = Deref(ARG3)) || !IsAtomTerm(t))
|
||||
return (FALSE);
|
||||
else
|
||||
mod = LookupModule(t);
|
||||
|
22
C/exec.c
22
C/exec.c
@ -1027,7 +1027,7 @@ execute_goal(Term t, int nargs, SMALLUNSGN mod)
|
||||
OldTopB = (choiceptr)(LCL0-MyOldTopB);
|
||||
OldDelayedB = (choiceptr)(LCL0-MyOldDelayedB);
|
||||
if (DelayedB != NULL) {
|
||||
if (YOUNGER_CP(DelayedB,B)) {
|
||||
if (YOUNGER_CP(B,DelayedB)) {
|
||||
/* we have a delayed cut to do */
|
||||
if (YOUNGER_CP(OldTopB,DelayedB)) {
|
||||
/* and this delayed cut is to before the c-code that actually called us */
|
||||
@ -1074,7 +1074,7 @@ execute_goal(Term t, int nargs, SMALLUNSGN mod)
|
||||
OldTopB = (choiceptr)(LCL0-MyOldTopB);
|
||||
OldDelayedB = (choiceptr)(LCL0-MyOldDelayedB);
|
||||
if (DelayedB != NULL) {
|
||||
if (YOUNGER_CP(DelayedB,B)) {
|
||||
if (YOUNGER_CP(B,DelayedB)) {
|
||||
/* we have a delayed cut to do */
|
||||
if (YOUNGER_CP(OldTopB,DelayedB)) {
|
||||
/* and this delayed cut is to before the c-code that actually called us */
|
||||
@ -1254,10 +1254,23 @@ Int
|
||||
JumpToEnv(Term t) {
|
||||
yamop *pos = (yamop *)(PredDollarCatch->LastClause);
|
||||
CELL *env;
|
||||
choiceptr first_func = NULL;
|
||||
|
||||
do {
|
||||
/* find the first choicepoint that may be a catch */
|
||||
while (B->cp_ap != pos) {
|
||||
/* we are already doing a catch */
|
||||
if (B->cp_ap == (yamop *)(PredHandleThrow->LastClause)) {
|
||||
if (DelayedB == NULL || YOUNGER_CP(B,DelayedB))
|
||||
DelayedB = B;
|
||||
P = (yamop *)FAILCODE;
|
||||
if (first_func != NULL) {
|
||||
B = first_func;
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
if (B->cp_ap == (yamop *) NOCODE && first_func == NULL)
|
||||
first_func = B;
|
||||
B = B->cp_b;
|
||||
}
|
||||
/* is it a continuation? */
|
||||
@ -1278,7 +1291,12 @@ JumpToEnv(Term t) {
|
||||
/* I could backtrack here, but it is easier to leave the unwinding
|
||||
to the emulator */
|
||||
B->cp_a3 = t;
|
||||
if (DelayedB == NULL || YOUNGER_CP(B,DelayedB))
|
||||
DelayedB = B;
|
||||
P = (yamop *)FAILCODE;
|
||||
if (first_func != NULL) {
|
||||
B = first_func;
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ putAtom(Atom atom) /* writes an atom */
|
||||
char *s = RepAtom(atom)->StrOfAE;
|
||||
wtype atom_or_symbol = AtomIsSymbols(s);
|
||||
|
||||
#define CRYPT_FOR_STEVE 1
|
||||
/* #define CRYPT_FOR_STEVE 1*/
|
||||
#ifdef CRYPT_FOR_STEVE
|
||||
if (GetValue(LookupAtom("crypt_atoms")) != TermNil && GetAProp(atom, OpProperty) == NIL) {
|
||||
char s[16];
|
||||
|
Reference in New Issue
Block a user