diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 07:58:38 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 07:58:38 +0000 |
commit | 18f605a29278d63207f10660fc2808438211f7d4 (patch) | |
tree | 577b7928723518b900ec19af060efefa76b38d33 /vm.c | |
parent | 01bdc85e63f94533cdcc69cfab090f645148a91e (diff) |
merge revision(s) 44380: [Backport #9296]
* proc.c (rb_mod_define_method): consider visibility only if self
in the caller is same as the receiver, otherwise make public as
well as old behavior. [ruby-core:57747] [Bug #9005]
[ruby-core:58497] [Bug #9141]
* vm.c (rb_vm_cref_in_context): return ruby level cref if self is
same.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -930,6 +930,15 @@ rb_vm_cref(void) return rb_vm_get_cref(cfp->iseq, cfp->ep); } +NODE * +rb_vm_cref_in_context(VALUE self) +{ + rb_thread_t *th = GET_THREAD(); + const rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp); + if (cfp->self != self) return NULL; + return rb_vm_get_cref(cfp->iseq, cfp->ep); +} + #if 0 void debug_cref(NODE *cref) |