mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* class.c (rb_prepend_module): make T_ICLASS object shady because
this T_ICLASS object seems to share method table with other class objects. It was causes WB miss. TODO: need to know the data structure. * test/ruby/test_module.rb: add a test for WB miss. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7f0a26e271
commit
9af743fe0e
3 changed files with 26 additions and 0 deletions
1
class.c
1
class.c
|
@ -826,6 +826,7 @@ rb_prepend_module(VALUE klass, VALUE module)
|
|||
origin = RCLASS_ORIGIN(klass);
|
||||
if (origin == klass) {
|
||||
origin = class_alloc(T_ICLASS, klass);
|
||||
OBJ_WB_UNPROTECT(origin); /* TODO: conservertive shading. Need more survery. */
|
||||
RCLASS_SET_SUPER(origin, RCLASS_SUPER(klass));
|
||||
RCLASS_SET_SUPER(klass, origin);
|
||||
RCLASS_ORIGIN(klass) = origin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue