refTypeCheck in src/ref.c:257 invokes undefined behavior. It declares but does not initialize a pointer and then immediately checks whether it is NULL. Based on the resulting error message, this is likely a typo and the check should instead check the function's first argument for NULL.