diff --git a/C/absmi.c b/C/absmi.c index 158053c94..9f694fba4 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -11155,8 +11155,8 @@ absmi(int inp) if (pen->PredFlags & MetaPredFlag) { if (f == FunctorModule) { Term tmod = LookupModule(ArgOfTerm(1,d0)); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + LookupModule(tmod) == mod) { d0 = ArgOfTerm(2,d0); goto execute_nvar; } @@ -11278,8 +11278,8 @@ absmi(int inp) if (f == FunctorModule) { Term tmod; tmod = ArgOfTerm(1,d0); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + mod == LookupModule(tmod)) { d0 = ArgOfTerm(2,d0); goto execute_within_nvar; } @@ -11422,8 +11422,8 @@ absmi(int inp) if (pen->PredFlags & MetaPredFlag) { if (f == FunctorModule) { Term tmod = ArgOfTerm(1,d0); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + mod == LookupModule(tmod)) { d0 = ArgOfTerm(2,d0); goto last_execute_within_nvar; } diff --git a/C/exec.c b/C/exec.c index b7017f20d..d88d5bbd7 100644 --- a/C/exec.c +++ b/C/exec.c @@ -226,8 +226,8 @@ do_execute(Term t, int mod) if (pen->PredFlags & MetaPredFlag) { if (f == FunctorModule) { Term tmod = ArgOfTerm(1,t); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + mod == LookupModule(tmod)) { t = ArgOfTerm(2,t); goto restart_exec; } @@ -332,8 +332,8 @@ p_execute_within(void) if (pen->PredFlags & MetaPredFlag) { if (f == FunctorModule) { Term tmod = ArgOfTerm(1,t); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + mod == LookupModule(tmod)) { t = ArgOfTerm(2,t); goto restart_exec; } @@ -798,8 +798,8 @@ p_at_execute(void) return(FALSE); if (f == FunctorModule) { Term tmod = ArgOfTerm(1,t); - if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) { - mod = LookupModule(tmod); + if (!IsVarTerm(tmod) && IsAtomTerm(tmod) && + mod == LookupModule(tmod)) { t = ArgOfTerm(2,t); goto restart_exec; } diff --git a/C/save.c b/C/save.c index d11ac9b1c..9bc6e00ec 100644 --- a/C/save.c +++ b/C/save.c @@ -182,10 +182,6 @@ mywrite(int fd, char *buff, Int len) #else /* SHORT_INTS */ -#if SUN -#include -#endif - inline static void myread(int fd, char *buffer, Int len) { int nread;