From 7da562e74074eaee8604b6049ff38f8bfccb6ac8 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 22 Jun 2013 20:48:35 +0000 Subject: * class.c (rb_include_class_new), eval.c (rb_using_refinement): make classes/modules (who share method table) shady. If module `a' and `b' shares method table m_tbl and new method with iseq is added, then write barrier is applied only `a' or `b'. To avoid this issue, shade such classes/modules. * vm_method.c (rb_method_entry_make): add write barriers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'class.c') diff --git a/class.c b/class.c index 21e39e2efe..b4614efadd 100644 --- a/class.c +++ b/class.c @@ -689,7 +689,9 @@ rb_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(RCLASS_ORIGIN(module)); + + RCLASS_M_TBL(OBJ_WB_GIVEUP(klass)) = RCLASS_M_TBL(OBJ_WB_GIVEUP(RCLASS_ORIGIN(module))); + RCLASS_SET_SUPER(klass, super); if (RB_TYPE_P(module, T_ICLASS)) { RBASIC_SET_CLASS(klass, RBASIC(module)->klass); -- cgit v1.2.3