From f03f35372238bb8eab567c56ed8d7ca592bd481a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 2 Dec 2010 19:25:10 +0000 Subject: [PATCH] make swi functors more robust to confusion with atoms. --- library/dialect/swi/fli/swi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/dialect/swi/fli/swi.h b/library/dialect/swi/fli/swi.h index 3032aece8..4155a0a74 100644 --- a/library/dialect/swi/fli/swi.h +++ b/library/dialect/swi/fli/swi.h @@ -117,10 +117,10 @@ FunctorToSWIFunctor(Functor at) static inline Functor SWIFunctorToFunctor(functor_t at) { + if ((CELL)(at) & 2 && ((CELL)at) < N_SWI_FUNCTORS*4+2) + return SWI_Functors[((CELL)at)/4]; if (IsAtomTerm(at)) return (Functor)at; - if ((CELL)(at) & 2) - return SWI_Functors[((CELL)at)/4]; return (Functor)at; }