diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 08:01:13 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 08:01:13 +0000 |
commit | c8590d60f1bc365cd462de7302351f6a15c9bf4e (patch) | |
tree | f2dfffee7626fbfd2c8f1e72f54d161342b534f8 | |
parent | 37b38306e85c80c809db0cc0a61d0aa562ef5158 (diff) |
* method.h: constify rb_method_alias_struct::original_me and
rb_method_refined_struct::orig_me.
* class.c (move_refined_method): use RB_OBJ_WRITE() for
me->def->body.refined.orig_me.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | class.c | 2 | ||||
-rw-r--r-- | method.h | 4 |
3 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,11 @@ +Thu Jun 18 16:58:35 2015 Koichi Sasada <ko1@atdot.net> + + * method.h: constify rb_method_alias_struct::original_me and + rb_method_refined_struct::orig_me. + + * class.c (move_refined_method): use RB_OBJ_WRITE() for + me->def->body.refined.orig_me. + Thu Jun 18 14:35:28 2015 Koichi Sasada <ko1@atdot.net> * ext/objspace/objspace.c (count_imemo_objects): support imemo_ment. @@ -915,7 +915,7 @@ move_refined_method(st_data_t key, st_data_t value, st_data_t data) if (me->def->type == VM_METHOD_TYPE_REFINED) { if (me->def->body.refined.orig_me) { const rb_method_entry_t *orig_me = me->def->body.refined.orig_me, *new_me; - me->def->body.refined.orig_me = NULL; + RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL); new_me = rb_method_entry_clone(me); st_add_direct(tbl, key, (st_data_t) new_me); rb_method_entry_copy(me, orig_me); @@ -122,11 +122,11 @@ typedef struct rb_method_attr_struct { } rb_method_attr_t; typedef struct rb_method_alias_struct { - const struct rb_method_entry_struct *original_me; /* original_me->klass is original owner */ + const struct rb_method_entry_struct * const original_me; /* original_me->klass is original owner */ } rb_method_alias_t; typedef struct rb_method_refined_struct { - const struct rb_method_entry_struct *orig_me; + const struct rb_method_entry_struct * const orig_me; } rb_method_refined_t; typedef struct rb_method_definition_struct { |