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

* vm_eval.c (rb_search_method_entry): show flags and klass value in

not implemented error message.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-11-21 09:49:30 +00:00
parent 75090a663b
commit 5181fa2a55
2 changed files with 26 additions and 10 deletions

View file

@ -1,3 +1,8 @@
Sat Nov 21 18:48:35 2009 Tanaka Akira <akr@fsij.org>
* vm_eval.c (rb_search_method_entry): show flags and klass value in
not implemented error message.
Sat Nov 21 16:38:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (marshal_dump): use normal object as the buffer so

View file

@ -336,22 +336,33 @@ rb_search_method_entry(VALUE recv, ID mid)
VALUE klass = CLASS_OF(recv);
if (!klass) {
if (!IMMEDIATE_P(recv) && RBASIC(recv)->flags != 0) {
if (IMMEDIATE_P(recv)) {
rb_raise(rb_eNotImpError,
"method `%s' called on unexpected immediate object (%p)",
rb_id2name(mid), (void *)recv);
}
if (RBASIC(recv)->flags == 0) {
rb_raise(rb_eNotImpError,
"method `%s' called on terminated object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
rb_id2name(mid), (void *)recv,
RBASIC(recv)->flags, RBASIC(recv)->klass);
}
else {
int type = BUILTIN_TYPE(recv);
const char *typestr = rb_type_str(type);
if (typestr)
rb_raise(rb_eNotImpError,
"method `%s' called on hidden %s object (%p)",
rb_id2name(mid), typestr, (void *)recv);
"method `%s' called on hidden %s object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
rb_id2name(mid), typestr, (void *)recv,
RBASIC(recv)->flags, RBASIC(recv)->klass);
else
rb_raise(rb_eNotImpError,
"method `%s' called on hidden T_???" "(0x%02x) object (%p)",
rb_id2name(mid), type, (void *)recv);
}
else {
rb_raise(rb_eNotImpError,
"method `%s' called on terminated object (%p)",
rb_id2name(mid), (void *)recv);
"method `%s' called on hidden T_???" "(0x%02x) object"
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
rb_id2name(mid), type, (void *)recv,
RBASIC(recv)->flags, RBASIC(recv)->klass);
}
}
return rb_method_entry(klass, mid);