mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* eval.c (rb_using_refinement): add write-barriers for
cref->nd_refinements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be29ae6b05
commit
7af941da15
2 changed files with 7 additions and 2 deletions
4
eval.c
4
eval.c
|
@ -1132,11 +1132,11 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
|
|||
Check_Type(klass, T_CLASS);
|
||||
Check_Type(module, T_MODULE);
|
||||
if (NIL_P(cref->nd_refinements)) {
|
||||
cref->nd_refinements = hidden_identity_hash_new();
|
||||
RB_OBJ_WRITE(cref, &cref->nd_refinements, hidden_identity_hash_new());
|
||||
}
|
||||
else {
|
||||
if (cref->flags & NODE_FL_CREF_OMOD_SHARED) {
|
||||
cref->nd_refinements = rb_hash_dup(cref->nd_refinements);
|
||||
RB_OBJ_WRITE(cref, &cref->nd_refinements, rb_hash_dup(cref->nd_refinements));
|
||||
cref->flags &= ~NODE_FL_CREF_OMOD_SHARED;
|
||||
}
|
||||
if (!NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue