From b6b76e3a85130dc24dbacd60a82033c780581e9b Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 5 Jun 2015 11:42:34 +0000 Subject: * internal.h: move definition of rb_cref_t to method.h. * eval_intern.h: move definition of rb_scope_visibility_t to method.h. * method.h: change rb_cref_t::scope_visi from VALUE to rb_scope_visibility_t. [Bug #11219] * vm.c (vm_cref_new): accept rb_method_visibility_t directly. * vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0, but METHOD_VISI_UNDEF. * vm_method.c (rb_scope_visibility_set): don't need to use cast. * vm_method.c (rb_scope_module_func_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index a772206aeb..b302674085 100644 --- a/vm.c +++ b/vm.c @@ -80,10 +80,16 @@ rb_vm_control_frame_block_ptr(const rb_control_frame_t *cfp) } static rb_cref_t * -vm_cref_new(VALUE klass, long visi, const rb_cref_t *prev_cref) +vm_cref_new(VALUE klass, rb_method_visibility_t visi, const rb_cref_t *prev_cref) { - rb_cref_t *cref = (rb_cref_t *)rb_imemo_new(imemo_cref, klass, visi, (VALUE)prev_cref, Qnil); - return cref; + union { + rb_scope_visibility_t visi; + VALUE value; + } scope_visi; + scope_visi.visi.method_visi = visi; + scope_visi.visi.module_func = 0; + + return (rb_cref_t *)rb_imemo_new(imemo_cref, klass, (VALUE)prev_cref, scope_visi.value, Qnil); } static rb_cref_t * -- cgit v1.2.3