Merge pull request #97 from k-tsj/fix-include-segv

Fix SEGV when including an object other than Module
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-05-04 05:19:36 -07:00
+1
View File
@@ -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;
}