Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07d6813

Browse filesBrowse files
committed
* vm_eval.c (rb_search_method_entry): refine error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 67bb2db commit 07d6813
Copy full SHA for 07d6813

File tree

Expand file treeCollapse file tree

2 files changed

+18
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-9
lines changed

‎ChangeLog

Copy file name to clipboardExpand all lines: ChangeLog
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Wed Nov 25 20:46:37 2009 Tanaka Akira <akr@fsij.org>
2+
3+
* vm_eval.c (rb_search_method_entry): refine error message.
4+
15
Wed Nov 25 19:29:05 2009 Akinori MUSHA <knu@iDaemons.org>
26

37
* ext/digest/digest.c (rb_digest_instance_method_unimpl): Do not

‎vm_eval.c

Copy file name to clipboardExpand all lines: vm_eval.c
+14-9Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,33 +336,38 @@ rb_search_method_entry(VALUE recv, ID mid)
336336
VALUE klass = CLASS_OF(recv);
337337

338338
if (!klass) {
339+
VALUE flags, klass;
339340
if (IMMEDIATE_P(recv)) {
340341
rb_raise(rb_eNotImpError,
341342
"method `%s' called on unexpected immediate object (%p)",
342343
rb_id2name(mid), (void *)recv);
343344
}
344-
if (RBASIC(recv)->flags == 0) {
345+
flags = RBASIC(recv)->flags;
346+
klass = RBASIC(recv)->klass;
347+
if (flags == 0) {
345348
rb_raise(rb_eNotImpError,
346349
"method `%s' called on terminated object"
347350
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
348-
rb_id2name(mid), (void *)recv,
349-
RBASIC(recv)->flags, RBASIC(recv)->klass);
351+
rb_id2name(mid), (void *)recv, flags, klass);
350352
}
351353
else {
352354
int type = BUILTIN_TYPE(recv);
353355
const char *typestr = rb_type_str(type);
354-
if (typestr)
356+
if (typestr && T_OBJECT <= type && type < T_NIL)
355357
rb_raise(rb_eNotImpError,
356358
"method `%s' called on hidden %s object"
357359
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
358-
rb_id2name(mid), typestr, (void *)recv,
359-
RBASIC(recv)->flags, RBASIC(recv)->klass);
360+
rb_id2name(mid), typestr, (void *)recv, flags, klass);
361+
if (typestr)
362+
rb_raise(rb_eNotImpError,
363+
"method `%s' called on unexpected %s object"
364+
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
365+
rb_id2name(mid), typestr, (void *)recv, flags, klass);
360366
else
361367
rb_raise(rb_eNotImpError,
362-
"method `%s' called on hidden T_???" "(0x%02x) object"
368+
"method `%s' called on broken T_???" "(0x%02x) object"
363369
" (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
364-
rb_id2name(mid), type, (void *)recv,
365-
RBASIC(recv)->flags, RBASIC(recv)->klass);
370+
rb_id2name(mid), type, (void *)recv, flags, klass);
366371
}
367372
}
368373
return rb_method_entry(klass, mid);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.