ruby-changes:32680
From: nobu <ko1@a...>
Date: Thu, 30 Jan 2014 17:25:50 +0900 (JST)
Subject: [ruby-changes:32680] nobu:r44759 (trunk): vm_eval.c: error message encoding
nobu 2014-01-30 17:25:46 +0900 (Thu, 30 Jan 2014) New Revision: 44759 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44759 Log: vm_eval.c: error message encoding * vm_eval.c (rb_search_method_entry): preserve encoding of method ID in error messages. Modified files: trunk/vm_eval.c Index: vm_eval.c =================================================================== --- vm_eval.c (revision 44758) +++ vm_eval.c (revision 44759) @@ -490,35 +490,35 @@ rb_search_method_entry(VALUE recv, ID mi https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L490 VALUE flags, klass; if (IMMEDIATE_P(recv)) { rb_raise(rb_eNotImpError, - "method `%s' called on unexpected immediate object (%p)", - rb_id2name(mid), (void *)recv); + "method `%"PRIsVALUE"' called on unexpected immediate object (%p)", + rb_id2str(mid), (void *)recv); } flags = RBASIC(recv)->flags; klass = RBASIC(recv)->klass; if (flags == 0) { rb_raise(rb_eNotImpError, - "method `%s' called on terminated object" + "method `%"PRIsVALUE"' called on terminated object" " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", - rb_id2name(mid), (void *)recv, flags, klass); + rb_id2str(mid), (void *)recv, flags, klass); } else { int type = BUILTIN_TYPE(recv); const char *typestr = rb_type_str(type); if (typestr && T_OBJECT <= type && type < T_NIL) rb_raise(rb_eNotImpError, - "method `%s' called on hidden %s object" + "method `%"PRIsVALUE"' called on hidden %s object" " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", - rb_id2name(mid), typestr, (void *)recv, flags, klass); + rb_id2str(mid), typestr, (void *)recv, flags, klass); if (typestr) rb_raise(rb_eNotImpError, - "method `%s' called on unexpected %s object" + "method `%"PRIsVALUE"' called on unexpected %s object" " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", - rb_id2name(mid), typestr, (void *)recv, flags, klass); + rb_id2str(mid), typestr, (void *)recv, flags, klass); else rb_raise(rb_eNotImpError, - "method `%s' called on broken T_???" "(0x%02x) object" + "method `%"PRIsVALUE"' called on broken T_???" "(0x%02x) object" " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")", - rb_id2name(mid), type, (void *)recv, flags, klass); + rb_id2str(mid), type, (void *)recv, flags, klass); } } return rb_method_entry(klass, mid, defined_class_ptr); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/