diff options
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index a35dbb1196..609e620151 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1252,6 +1252,16 @@ vm_get_cvar_base(NODE *cref) return klass; } +static int +vm_const_defined_at(VALUE cbase, ID id, int newclass) +{ + int ret = rb_const_defined_at(cbase, id); + if (!ret && !newclass) { + while ((cbase = RCLASS_SUPER(cbase)) != 0 && cbase != rb_cObject && + !(ret = rb_const_defined_at(cbase, id))); + } + return ret; +} #ifndef USE_IC_FOR_IVAR #define USE_IC_FOR_IVAR 1 |