don't crash strip_module
This commit is contained in:
parent
e0642dbaa3
commit
a012017635
@ -299,15 +299,11 @@ Yap_StripModule(Term t, Term *modp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
restart:
|
restart:
|
||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t) || !IsApplTerm(t)) {
|
||||||
if (modp)
|
if (modp)
|
||||||
*modp = tmod;
|
*modp = tmod;
|
||||||
return t;
|
return t;
|
||||||
} else if (IsAtomTerm(t) || IsPairTerm(t)) {
|
} else {
|
||||||
if (modp)
|
|
||||||
*modp = tmod;
|
|
||||||
return t;
|
|
||||||
} else if (IsApplTerm(t)) {
|
|
||||||
Functor fun = FunctorOfTerm(t);
|
Functor fun = FunctorOfTerm(t);
|
||||||
if (fun == FunctorModule) {
|
if (fun == FunctorModule) {
|
||||||
Term t1 = ArgOfTerm(1, t);
|
Term t1 = ArgOfTerm(1, t);
|
||||||
|
Reference in New Issue
Block a user