Kernel#initialize should not break existing mt; fix #3397

This issue was reported by https://hackerone.com/icanthack
The solution is suggested by @clayton-shopify.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-01-12 21:43:23 +09:00
parent 41eff635bf
commit 38acb9ec36
+3 -1
View File
@@ -915,7 +915,9 @@ boot_defclass(mrb_state *mrb, struct RClass *super)
static void
boot_initmod(mrb_state *mrb, struct RClass *mod)
{
mod->mt = kh_init(mt, mrb);
if (!mod->mt) {
mod->mt = kh_init(mt, mrb);
}
}
static struct RClass*