Revert "ENV may not be in scope of catch in very special cases (eg, call counter)."
This reverts commit 15f9a68a35
.
Botch!
This commit is contained in:
parent
15f9a68a35
commit
69c0a52548
15
C/exec.c
15
C/exec.c
@ -1570,6 +1570,7 @@ JumpToEnv(Term t) {
|
|||||||
if (!(t = Yap_SaveTerm(t)))
|
if (!(t = Yap_SaveTerm(t)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
do {
|
||||||
/* find the first choicepoint that may be a catch */
|
/* find the first choicepoint that may be a catch */
|
||||||
while (B != NULL && B->cp_ap != pos) {
|
while (B != NULL && B->cp_ap != pos) {
|
||||||
/* we are already doing a catch */
|
/* we are already doing a catch */
|
||||||
@ -1599,7 +1600,19 @@ JumpToEnv(Term t) {
|
|||||||
siglongjmp(Yap_RestartEnv,1);
|
siglongjmp(Yap_RestartEnv,1);
|
||||||
}
|
}
|
||||||
/* is it a continuation? */
|
/* is it a continuation? */
|
||||||
env = ENV = B->cp_env;
|
env = B->cp_env;
|
||||||
|
while (env > ENV) {
|
||||||
|
ENV = ENV_Parent(ENV);
|
||||||
|
}
|
||||||
|
/* yes, we found it ! */
|
||||||
|
// while (env < ENV)
|
||||||
|
// env = ENV_Parent(env);
|
||||||
|
if (env == ENV) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* oops, try next */
|
||||||
|
B = B->cp_b;
|
||||||
|
} while (TRUE);
|
||||||
/* step one environment above, otherwise we'll redo the original goal */
|
/* step one environment above, otherwise we'll redo the original goal */
|
||||||
B->cp_cp = (yamop *)env[E_CP];
|
B->cp_cp = (yamop *)env[E_CP];
|
||||||
B->cp_env = (CELL *)env[E_E];
|
B->cp_env = (CELL *)env[E_E];
|
||||||
|
Reference in New Issue
Block a user