зеркало из https://github.com/github/ruby.git
* vm_method.c (rb_method_entry_create): need to call
method_definition_reset() if def is given. Actually, `me' is a new object, so we don't need to call it. It is just to make sure. * vm_method.c (method_definition_reset): remove duplicated insertion. * vm_method.c (rb_method_entry_clone): assgine dst->def here, not in method_definition_reset(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f4d71ad509
Коммит
7bba6adc56
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Thu Jun 25 17:32:33 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_method.c (rb_method_entry_create): need to call
|
||||
method_definition_reset() if def is given.
|
||||
|
||||
Actually, `me' is a new object, so we don't need to call it.
|
||||
It is just to make sure.
|
||||
|
||||
* vm_method.c (method_definition_reset): remove duplicated insertion.
|
||||
|
||||
* vm_method.c (rb_method_entry_clone): assgine dst->def here,
|
||||
not in method_definition_reset().
|
||||
|
||||
Thu Jun 25 16:44:54 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_method.c: make a rb_method_definition_t data (def) *after* making
|
||||
|
|
|
@ -283,9 +283,9 @@ method_definition_set(rb_method_entry_t *me, rb_method_definition_t *def, void *
|
|||
}
|
||||
|
||||
static void
|
||||
method_definition_reset(const rb_method_entry_t *me, rb_method_definition_t *def)
|
||||
method_definition_reset(const rb_method_entry_t *me)
|
||||
{
|
||||
*(rb_method_definition_t **)&me->def = def;
|
||||
rb_method_definition_t *def = me->def;
|
||||
|
||||
switch(def->type) {
|
||||
case VM_METHOD_TYPE_ISEQ:
|
||||
|
@ -338,6 +338,7 @@ rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, c
|
|||
{
|
||||
rb_method_entry_t *me = (rb_method_entry_t *)rb_imemo_new(imemo_ment, (VALUE)def, (VALUE)called_id, (VALUE)klass, 0);
|
||||
METHOD_ENTRY_FLAGS_SET(me, visi, ruby_running ? FALSE : TRUE, rb_safe_level());
|
||||
if (def != NULL) method_definition_reset(me);
|
||||
return me;
|
||||
}
|
||||
|
||||
|
@ -353,7 +354,8 @@ rb_method_entry_clone(const rb_method_entry_t *src_me)
|
|||
void
|
||||
rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src)
|
||||
{
|
||||
method_definition_reset(dst, method_definition_addref(src->def));
|
||||
*(rb_method_definition_t **)&dst->def = method_definition_addref(src->def);
|
||||
method_definition_reset(dst);
|
||||
dst->called_id = src->called_id;
|
||||
RB_OBJ_WRITE((VALUE)dst, &dst->klass, src->klass);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче