From a0120176353bbbb7b9f29fac43fd536da7683c06 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 9 Feb 2014 18:07:17 +0000 Subject: [PATCH] don't crash strip_module --- C/modules.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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);