fix breakage in ball access

fix unnecuessary --ASP (why?)
This commit is contained in:
Vitor Santos Costa 2010-07-27 23:21:15 +01:00
parent 5b7f04b4b6
commit 07907f1839
2 changed files with 15 additions and 14 deletions

View File

@ -968,7 +968,7 @@ exec_absmi(int top)
/* H is not so important, because we're gonna backtrack */ /* H is not so important, because we're gonna backtrack */
restore_H(); restore_H();
/* set stack */ /* set stack */
ASP =(CELL *) PROTECT_FROZEN_B(B); ASP = (CELL *)PROTECT_FROZEN_B(B);
Yap_StartSlots(); Yap_StartSlots();
LOCK(SignalLock); LOCK(SignalLock);
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();

View File

@ -3780,7 +3780,7 @@ int beam_write (void)
Yap_plwrite (ARG1, Stream[Yap_c_output_stream].stream_wputc, 0, 1200); Yap_plwrite (ARG1, Stream[Yap_c_output_stream].stream_wputc, 0, 1200);
Yap_CloseSlots(); Yap_CloseSlots();
if (EX != 0L) { if (EX != 0L) {
Term ball = EX; Term ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = 0L;
Yap_JumpToEnv(ball); Yap_JumpToEnv(ball);
return(FALSE); return(FALSE);
@ -3800,8 +3800,8 @@ p_write (void)
Yap_plwrite (ARG2, Stream[Yap_c_output_stream].stream_wputc, flags, 1200); Yap_plwrite (ARG2, Stream[Yap_c_output_stream].stream_wputc, flags, 1200);
Yap_CloseSlots(); Yap_CloseSlots();
if (EX != 0L) { if (EX != 0L) {
Term ball = EX; Term ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = NULL;
Yap_JumpToEnv(ball); Yap_JumpToEnv(ball);
return(FALSE); return(FALSE);
} }
@ -3819,8 +3819,8 @@ p_write_prio (void)
Yap_plwrite (ARG3, Stream[Yap_c_output_stream].stream_wputc, flags, (int)IntOfTerm(Deref(ARG2))); Yap_plwrite (ARG3, Stream[Yap_c_output_stream].stream_wputc, flags, (int)IntOfTerm(Deref(ARG2)));
Yap_CloseSlots(); Yap_CloseSlots();
if (EX != 0L) { if (EX != 0L) {
Term ball = EX; Term ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = NULL;
Yap_JumpToEnv(ball); Yap_JumpToEnv(ball);
return(FALSE); return(FALSE);
} }
@ -3844,8 +3844,8 @@ p_write2_prio (void)
Yap_CloseSlots(); Yap_CloseSlots();
Yap_c_output_stream = old_output_stream; Yap_c_output_stream = old_output_stream;
if (EX != 0L) { if (EX != 0L) {
Term ball = EX; Term ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = NULL;
Yap_JumpToEnv(ball); Yap_JumpToEnv(ball);
return(FALSE); return(FALSE);
} }
@ -3869,8 +3869,8 @@ p_write2 (void)
Yap_CloseSlots(); Yap_CloseSlots();
Yap_c_output_stream = old_output_stream; Yap_c_output_stream = old_output_stream;
if (EX != 0L) { if (EX != 0L) {
Term ball = EX; Term ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = NULL;
Yap_JumpToEnv(ball); Yap_JumpToEnv(ball);
return(FALSE); return(FALSE);
} }
@ -5511,8 +5511,8 @@ format(volatile Term otail, volatile Term oargs, int sno)
Term ball; Term ball;
ex_handler: ex_handler:
ball = EX; ball = Yap_PopTermFromDB(EX);
EX = 0L; EX = NULL;
if (tnum <= 8) if (tnum <= 8)
targs = NULL; targs = NULL;
if (IsAtomTerm(tail)) { if (IsAtomTerm(tail)) {
@ -6402,10 +6402,11 @@ Yap_TermToString(Term t, char *s, unsigned int sz, int flags)
Yap_plwrite (t, Stream[sno].stream_wputc, flags, 1200); Yap_plwrite (t, Stream[sno].stream_wputc, flags, 1200);
Yap_CloseSlots(); Yap_CloseSlots();
s[Stream[sno].u.mem_string.pos] = '\0'; s[Stream[sno].u.mem_string.pos] = '\0';
LOCK(Stream[sno].streamlock);
Stream[sno].status = Free_Stream_f; Stream[sno].status = Free_Stream_f;
UNLOCK(Stream[sno].streamlock);
Yap_c_output_stream = old_output_stream; Yap_c_output_stream = old_output_stream;
++ASP; return EX != NULL;
return EX;
} }
FILE * FILE *