fix longmp in trow not to recover trail. This way we do not need to do

copy_term/2 and we avoid losing the attributed variable stack.
This commit is contained in:
Vítor Santos de Costa 2008-10-18 11:03:25 +01:00
parent 87987d0b85
commit 7207c18e65
6 changed files with 9 additions and 9 deletions

View File

@ -1925,6 +1925,8 @@ JumpToEnv(Term t) {
B->cp_env = (CELL *)env[E_E]; B->cp_env = (CELL *)env[E_E];
/* cannot recover Heap because of copy term :-( */ /* cannot recover Heap because of copy term :-( */
B->cp_h = H; B->cp_h = H;
/* nor can I recover terms */
B->cp_tr = TR;
/* I could backtrack here, but it is easier to leave the unwinding /* I could backtrack here, but it is easier to leave the unwinding
to the emulator */ to the emulator */
B->cp_a3 = t; B->cp_a3 = t;

View File

@ -723,7 +723,7 @@ CopyTermToArena(Term t, Term arena, int share, UInt arity, Term *newarena, Term
CELL *oldH = H; CELL *oldH = H;
CELL *oldHB = HB; CELL *oldHB = HB;
CELL *oldASP = ASP; CELL *oldASP = ASP;
int res; int res = 0;
#if COROUTINING #if COROUTINING
Term old_delay_arena; Term old_delay_arena;
#endif #endif

View File

@ -856,9 +856,9 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit)
fprintf(Yap_stderr, "%% %cO Total of %g sec expanding stacks \n", vb_msg1, (double)total_delay_overflow_time/1000); fprintf(Yap_stderr, "%% %cO Total of %g sec expanding stacks \n", vb_msg1, (double)total_delay_overflow_time/1000);
} }
LeaveGrowMode(GrowStackMode); LeaveGrowMode(GrowStackMode);
if (hsplit) if (hsplit) {
return GDiff-GDiff0; return size0;
else } else
return GDiff-DelayDiff; return GDiff-DelayDiff;
} }

View File

@ -62,7 +62,7 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args)
if (i > 0) fprintf(Yap_stderr, ","); if (i > 0) fprintf(Yap_stderr, ",");
#if DEBUG #if DEBUG
#if COROUTINING #if COROUTINING
Yap_Portray_delays = FALSE; Yap_Portray_delays = TRUE;
#endif #endif
#endif #endif
omax_depth = max_depth; omax_depth = max_depth;

View File

@ -149,7 +149,7 @@ inline EXTERN CELL DelayAdjust (CELL);
inline EXTERN CELL inline EXTERN CELL
DelayAdjust (CELL val) DelayAdjust (CELL val)
{ {
return (CELL) ((val + DelayDiff)); return (CELL) (val + DelayDiff);
} }

View File

@ -1138,10 +1138,8 @@ catch(G, C, A) :-
% throw has to be *exactly* after system catch! % throw has to be *exactly* after system catch!
% %
throw(Ball) :- throw(Ball) :-
% get this off the unwound computation.
duplicate_term(Ball,NewBall),
% get current jump point % get current jump point
'$jump_env_and_store_ball'(NewBall). '$jump_env_and_store_ball'(Ball).
% just create a choice-point % just create a choice-point