mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix SEGV when including an object other than Module
This commit is contained in:
@@ -502,6 +502,7 @@ mrb_mod_include(mrb_state *mrb, mrb_value klass)
|
||||
mrb_value mod;
|
||||
|
||||
mrb_get_args(mrb, "o", &mod);
|
||||
mrb_check_type(mrb, mod, MRB_TT_MODULE);
|
||||
mrb_include_module(mrb, mrb_class_ptr(klass), mrb_class_ptr(mod));
|
||||
return mod;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user