Add assertion we can pack function pointers in mrb_method_t.

If this assertion fails, you have to define `MRB_USE_METHOD_T_STRUCT`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-08-14 07:54:18 +09:00
parent 72d071540c
commit d4b89ccc61
+3
View File
@@ -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);
}