Add assertion we can pack function pointers in `mrb_method_t`.

If this assertion fails, you have to define `MRB_USE_METHOD_T_STRUCT`.
parent 72d07154
......@@ -521,6 +521,9 @@ mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t f
int ai = mrb_gc_arena_save(mrb);
MRB_METHOD_FROM_FUNC(m, func);
#ifndef MRB_USE_METHOD_T_STRUCT
mrb_assert(MRB_METHOD_FUNC(m) == func);
#endif
if (aspec == MRB_ARGS_NONE()) {
MRB_METHOD_NOARG_SET(m);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment