fix error messages

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@338 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-01-30 00:28:42 +00:00
parent 0fa942e238
commit be135b514f
2 changed files with 7 additions and 7 deletions

View File

@ -319,7 +319,7 @@ Error (yap_error_number type, Term where, char *format,...)
if (type == PURE_ABORT)
where = TermNil;
else
where = Deref(where);
where = CopyTerm(Deref(where));
if (IsVarTerm(where)) {
/* we must be careful someone gave us a copy to a local variable */
Term t = MkVarTerm();
@ -327,6 +327,7 @@ Error (yap_error_number type, Term where, char *format,...)
where = Deref(where);
}
PrologMode |= InErrorMode;
where = CopyTerm(where);
va_start (ap, format);
/* now build the error string */
if (format != NULL)
@ -1752,7 +1753,7 @@ Error (yap_error_number type, Term where, char *format,...)
if (type == PURE_ABORT)
JumpToEnv(MkAtomTerm(LookupAtom("abort")));
else
JumpToEnv(CopyTerm(MkApplTerm(fun, 2, nt)));
JumpToEnv(MkApplTerm(fun, 2, nt));
P = (yamop *)FAILCODE;
}
PrologMode &= ~InErrorMode;

View File

@ -251,10 +251,9 @@ module(N) :-
( '$check_import'(M,T,N,K) ->
% '$format'(user_error,"[vsc1: Importing ~w to ~w]~n",[M:N/K,T]),
( T = user ->
( recordzifnot('$import','$import'(M,user,N,K),_) -> write(importing(M,T,N,K)),nl
; true)
( recordzifnot('$import','$import'(M,user,N,K),_) -> true ; true)
;
( recordaifnot('$import','$import'(M,T,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
( recordaifnot('$import','$import'(M,T,N,K),_) -> true ; true )
)
;
true
@ -292,9 +291,9 @@ module(N) :-
% '$trace_module'(importing(M:N/K,Mod)),
% '$format'(user_error,"[vsc2: Importing ~w to ~w]~n",[M:N/K,T]),
(Mod = user ->
( recordzifnot('$import','$import'(M,user,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
( recordzifnot('$import','$import'(M,user,N,K),_) -> true ; true )
;
( recordaifnot('$import','$import'(M,Mod,N,K),_) -> write(importing(M,T,N,K)),nl ; true )
( recordaifnot('$import','$import'(M,Mod,N,K),_) -> true ; true )
)
;
true