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