From be135b514ffbe82786fef5f096933b7c67f16547 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 30 Jan 2002 00:28:42 +0000 Subject: [PATCH] fix error messages git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@338 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/errors.c | 5 +++-- pl/modules.yap | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C/errors.c b/C/errors.c index 7278e9f42..1fc418464 100644 --- a/C/errors.c +++ b/C/errors.c @@ -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; diff --git a/pl/modules.yap b/pl/modules.yap index 81c22e430..de86825bc 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -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