diff --git a/src/h.h b/src/h.h index 75f265f8..f3fd39f6 100644 --- a/src/h.h +++ b/src/h.h @@ -456,7 +456,7 @@ FORCE_INLINE bool isF64(B x) { return (x.u<<1) - ((0xFFEull<<52) + 2) >= (1ull<< FORCE_INLINE bool isNum(B x) { return isF64(x); } FORCE_INLINE bool isAtm(B x) { return !isArr(x); } -FORCE_INLINE bool isCallable(B x) { return isMd(x) | isFun(x); } +FORCE_INLINE bool isCallable(B x) { u16 tag = x.u>>48; return tag>=MD1_TAG && tag<=FUN_TAG; } FORCE_INLINE bool isPrim(B x) { return isCallable(x) && RTID(x)!=RTID_NONE; } diff --git a/src/load.c b/src/load.c index ad44f3fd..34cb1881 100644 --- a/src/load.c +++ b/src/load.c @@ -859,6 +859,8 @@ void base_init() { // very first init function // making sure that expected properties of constants hold assert((MD1_TAG>>1) == (MD2_TAG>>1)); // dependencies: isMd + assert(MD1_TAG+1 == MD2_TAG); // dependencies: isCallable + assert(MD2_TAG+1 == FUN_TAG); // dependencies: isCallable // dependencies: v_tagCheck & the JIT equivalent assert(v_bad17_read == (bi_noVar.u >>47));