diff --git a/C/modules.c b/C/modules.c index 431ce86f1..a23e545bf 100644 --- a/C/modules.c +++ b/C/modules.c @@ -299,15 +299,11 @@ Yap_StripModule(Term t, Term *modp) } } restart: - if (IsVarTerm(t)) { + if (IsVarTerm(t) || !IsApplTerm(t)) { if (modp) *modp = tmod; return t; - } else if (IsAtomTerm(t) || IsPairTerm(t)) { - if (modp) - *modp = tmod; - return t; - } else if (IsApplTerm(t)) { + } else { Functor fun = FunctorOfTerm(t); if (fun == FunctorModule) { Term t1 = ArgOfTerm(1, t);