diff --git a/lib/exec.c b/lib/exec.c index 70ddaf9..35a203a 100644 --- a/lib/exec.c +++ b/lib/exec.c @@ -960,7 +960,8 @@ static HCL_INLINE int call_primitive (hcl_t* hcl, hcl_ooi_t nargs) hcl_oop_word_t rcv; rcv = (hcl_oop_word_t)HCL_STACK_GETRCV(hcl, nargs); - HCL_ASSERT (hcl, HCL_IS_PRIM (hcl, rcv)); + HCL_ASSERT (hcl, HCL_IS_PRIM(hcl, rcv)); + HCL_ASSERT (hcl, HCL_OBJ_GET_SIZE(rcv) == 4); if (nargs < rcv->slot[1] && nargs > rcv->slot[2]) { @@ -972,7 +973,7 @@ static HCL_INLINE int call_primitive (hcl_t* hcl, hcl_ooi_t nargs) return -1; } - return ((hcl_pfimpl_t)rcv->slot[0]) (hcl, (hcl_mod_t*)rcv->slot[4], nargs); + return ((hcl_pfimpl_t)rcv->slot[0]) (hcl, (hcl_mod_t*)rcv->slot[3], nargs); } /* ------------------------------------------------------------------------- */ diff --git a/lib/prim.c b/lib/prim.c index 80949bb..8ae1e5e 100644 --- a/lib/prim.c +++ b/lib/prim.c @@ -49,7 +49,7 @@ hcl_oop_t hcl_makeprim (hcl_t* hcl, hcl_pfimpl_t primimpl, hcl_oow_t minargs, hc obj->slot[0] = (hcl_oow_t)primimpl; obj->slot[1] = minargs; obj->slot[2] = maxargs; - obj->slot[4] = (hcl_oow_t)mod; + obj->slot[3] = (hcl_oow_t)mod; } return (hcl_oop_t)obj;