class.c: fix duplication of prepended module

* class.c (include_class_new): fix duplication of prepended module.
  since m_tbl of prepended module is always zero, copy from its
  copy iclass of original.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-31 15:33:23 +00:00
parent bc08bdc013
commit b283d01987
3 changed files with 16 additions and 1 deletions

View file

@ -636,7 +636,7 @@ include_class_new(VALUE module, VALUE super)
}
RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
RCLASS_M_TBL(klass) = RCLASS_M_TBL(RCLASS_ORIGIN(module));
RCLASS_SUPER(klass) = super;
if (RB_TYPE_P(module, T_ICLASS)) {
RBASIC(klass)->klass = RBASIC(module)->klass;