mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
vm.c: check cbase
* vm.c (rb_vm_cref_in_context): check also cbase, not only self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fb725a20e2
commit
20c38381a8
2 changed files with 9 additions and 6 deletions
6
proc.c
6
proc.c
|
@ -14,7 +14,7 @@
|
|||
#include "gc.h"
|
||||
#include "iseq.h"
|
||||
|
||||
NODE *rb_vm_cref_in_context(VALUE self);
|
||||
const NODE *rb_vm_cref_in_context(VALUE self, VALUE cbase);
|
||||
|
||||
struct METHOD {
|
||||
VALUE recv;
|
||||
|
@ -1622,9 +1622,9 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
|
|||
ID id;
|
||||
VALUE body;
|
||||
int noex = NOEX_PUBLIC;
|
||||
const NODE *cref = rb_vm_cref_in_context(mod);
|
||||
const NODE *cref = rb_vm_cref_in_context(mod, mod);
|
||||
|
||||
if (cref && cref->nd_clss == mod) {
|
||||
if (cref) {
|
||||
noex = (int)cref->nd_visi;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue