make swi functors more robust to confusion with atoms.

This commit is contained in:
Vítor Santos Costa 2010-12-02 19:25:10 +00:00
parent 514758e65b
commit f03f353722

View File

@ -117,10 +117,10 @@ FunctorToSWIFunctor(Functor at)
static inline Functor static inline Functor
SWIFunctorToFunctor(functor_t at) SWIFunctorToFunctor(functor_t at)
{ {
if ((CELL)(at) & 2 && ((CELL)at) < N_SWI_FUNCTORS*4+2)
return SWI_Functors[((CELL)at)/4];
if (IsAtomTerm(at)) if (IsAtomTerm(at))
return (Functor)at; return (Functor)at;
if ((CELL)(at) & 2)
return SWI_Functors[((CELL)at)/4];
return (Functor)at; return (Functor)at;
} }