From c19d37375074987b36413af6bf83df7262ce227d Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 6 Jun 2015 10:19:48 +0000 Subject: * method.h: back to share rb_method_definition_t by rb_method_entry_t. r50728 changed sharing `def's to isolating `def's on alias and so on. However, this change conflicts future improvement plan. So I change back to sharing approach. * method.h: move rb_method_definition_t::flags to rb_method_entry_t::attr::flags. rb_method_entry_t::attr is union with VALUE because this field should have same size of VALUE. rb_method_entry_t is T_IMEMO). And also add the following access macros to it's fileds. * METHOD_ENTRY_VISI(me) * METHOD_ENTRY_BASIC(me) * METHOD_ENTRY_SAFE(me) * vm_method.c (rb_method_definition_addref): added instead of rb_method_definition_clone(). Do not create new definition, but increment alias_count. * class.c (clone_method): catch up this fix. * class.c (method_entry_i): ditto. * proc.c (mnew_internal): ditto. * proc.c (mnew_missing): ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 5300f704ca..fd2277f448 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -387,7 +387,7 @@ check_funcall_respond_to(rb_thread_t *th, VALUE klass, VALUE recv, ID mid) VALUE defined_class; const rb_method_entry_t *me = rb_method_entry(klass, idRespond_to, &defined_class); - if (me && !me->def->flags.basic) { + if (me && !METHOD_ENTRY_BASIC(me)) { const rb_block_t *passed_block = th->passed_block; VALUE args[2], result; int arity = rb_method_entry_arity(me); @@ -570,7 +570,7 @@ rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type sc } klass = me->klass; oid = me->def->original_id; - visi = me->def->flags.visi; + visi = METHOD_ENTRY_VISI(me); if (oid != idMethodMissing) { /* receiver specified form for private method */ @@ -592,7 +592,7 @@ rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type sc } } - if (me->def->flags.safe > th->safe_level) { + if (METHOD_ENTRY_SAFE(me) > th->safe_level) { rb_raise(rb_eSecurityError, "calling insecure method: %"PRIsVALUE, rb_id2str(me->called_id)); } } -- cgit v1.2.3