use *m in Yap_strip_module, not CurrentModule

This commit is contained in:
Vítor Santos Costa 2013-11-25 11:25:56 +01:00
parent 5ecf7a79ff
commit 4e7e9b0273

View File

@ -301,12 +301,16 @@ Yap_StripModule(Term t, Term *modp)
CACHE_REGS CACHE_REGS
Term tmod; Term tmod;
tmod = CurrentModule; if (modp)
tmod = *modp;
else
tmod = CurrentModule;
restart: restart:
if (IsVarTerm(t)) { if (IsVarTerm(t)) {
return 0L; return 0L;
} else if (IsAtomTerm(t) || IsPairTerm(t)) { } else if (IsAtomTerm(t) || IsPairTerm(t)) {
*modp = tmod; if (modp)
*modp = tmod;
return t; return t;
} else if (IsApplTerm(t)) { } else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t); Functor fun = FunctorOfTerm(t);
@ -321,7 +325,8 @@ Yap_StripModule(Term t, Term *modp)
t = ArgOfTerm(2, t); t = ArgOfTerm(2, t);
goto restart; goto restart;
} }
*modp = tmod; if (modp)
*modp = tmod;
return t; return t;
} }
return 0L; return 0L;