summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-22 20:48:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-22 20:48:35 +0000
commit7da562e74074eaee8604b6049ff38f8bfccb6ac8 (patch)
tree253d6daeb4de305fb80b794ec7d660748adc8c51 /eval.c
parent93ec82ca77ced0a17d447bbb5a4cca4c2c857567 (diff)
downloadruby-7da562e74074eaee8604b6049ff38f8bfccb6ac8.tar.gz
* 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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index c6b6aad8b4..6d6eb55426 100644
--- a/eval.c
+++ b/eval.c
@@ -1099,7 +1099,9 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
FL_SET(module, RMODULE_IS_OVERLAID);
c = iclass = rb_include_class_new(module, superclass);
RCLASS_REFINED_CLASS(c) = klass;
- RCLASS_M_TBL(c) = RCLASS_M_TBL(module);
+
+ RCLASS_M_TBL(OBJ_WB_GIVEUP(c)) = RCLASS_M_TBL(OBJ_WB_GIVEUP(module));
+
module = RCLASS_SUPER(module);
while (module && module != klass) {
FL_SET(module, RMODULE_IS_OVERLAID);