1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vm_eval.c: omit klass

* vm_eval.c (rb_search_method_entry): also Qfalse and Qnil are
  immediate values, so have no RBASIC.  omit klass, which is 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-01-30 08:43:04 +00:00
parent 34c635456c
commit 0f34ff4614

View file

@ -487,19 +487,18 @@ rb_search_method_entry(VALUE recv, ID mid, VALUE *defined_class_ptr)
VALUE klass = CLASS_OF(recv); VALUE klass = CLASS_OF(recv);
if (!klass) { if (!klass) {
VALUE flags, klass; VALUE flags;
if (IMMEDIATE_P(recv)) { if (SPECIAL_CONST_P(recv)) {
rb_raise(rb_eNotImpError, rb_raise(rb_eNotImpError,
"method `%"PRIsVALUE"' called on unexpected immediate object (%p)", "method `%"PRIsVALUE"' called on unexpected immediate object (%p)",
rb_id2str(mid), (void *)recv); rb_id2str(mid), (void *)recv);
} }
flags = RBASIC(recv)->flags; flags = RBASIC(recv)->flags;
klass = RBASIC(recv)->klass;
if (flags == 0) { if (flags == 0) {
rb_raise(rb_eNotImpError, rb_raise(rb_eNotImpError,
"method `%"PRIsVALUE"' called on terminated object" "method `%"PRIsVALUE"' called on terminated object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", " (%p flags=0x%"PRIxVALUE")",
rb_id2str(mid), (void *)recv, flags, klass); rb_id2str(mid), (void *)recv, flags);
} }
else { else {
int type = BUILTIN_TYPE(recv); int type = BUILTIN_TYPE(recv);
@ -507,18 +506,18 @@ rb_search_method_entry(VALUE recv, ID mid, VALUE *defined_class_ptr)
if (typestr && T_OBJECT <= type && type < T_NIL) if (typestr && T_OBJECT <= type && type < T_NIL)
rb_raise(rb_eNotImpError, rb_raise(rb_eNotImpError,
"method `%"PRIsVALUE"' called on hidden %s object" "method `%"PRIsVALUE"' called on hidden %s object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", " (%p flags=0x%"PRIxVALUE")",
rb_id2str(mid), typestr, (void *)recv, flags, klass); rb_id2str(mid), typestr, (void *)recv, flags);
if (typestr) if (typestr)
rb_raise(rb_eNotImpError, rb_raise(rb_eNotImpError,
"method `%"PRIsVALUE"' called on unexpected %s object" "method `%"PRIsVALUE"' called on unexpected %s object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", " (%p flags=0x%"PRIxVALUE")",
rb_id2str(mid), typestr, (void *)recv, flags, klass); rb_id2str(mid), typestr, (void *)recv, flags);
else else
rb_raise(rb_eNotImpError, rb_raise(rb_eNotImpError,
"method `%"PRIsVALUE"' called on broken T_???" "(0x%02x) object" "method `%"PRIsVALUE"' called on broken T_???" "(0x%02x) object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", " (%p flags=0x%"PRIxVALUE")",
rb_id2str(mid), type, (void *)recv, flags, klass); rb_id2str(mid), type, (void *)recv, flags);
} }
} }
return rb_method_entry(klass, mid, defined_class_ptr); return rb_method_entry(klass, mid, defined_class_ptr);