summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 18:44:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 18:44:12 +0000
commitf2fc80cebeafdb0c8e354b31825f192c7d40825e (patch)
treed9acd65c01865732067241eb5b10f10d68bec22f /vm_method.c
parent5d4aad2b1b7e5a941bf0ed87d280333301183a25 (diff)
vm_method.c: preserve encodings
* vm_method.c (rb_method_entry_make): preserve encodings of constant names in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm_method.c b/vm_method.c
index b722d050e1..1f397e3115 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -322,7 +322,7 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type,
old_def->type != VM_METHOD_TYPE_ZSUPER) {
rb_iseq_t *iseq = 0;
- rb_warning("method redefined; discarding old %s", rb_id2name(mid));
+ rb_warning("method redefined; discarding old %"PRIsVALUE, rb_id2str(mid));
switch (old_def->type) {
case VM_METHOD_TYPE_ISEQ:
iseq = old_def->body.iseq;
@@ -336,8 +336,8 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type,
if (iseq && !NIL_P(iseq->location.path)) {
int line = iseq->line_info_table ? FIX2INT(rb_iseq_first_lineno(iseq->self)) : 0;
rb_compile_warning(RSTRING_PTR(iseq->location.path), line,
- "previous definition of %s was here",
- rb_id2name(old_def->original_id));
+ "previous definition of %"PRIsVALUE" was here",
+ rb_id2str(old_def->original_id));
}
}
@@ -762,8 +762,8 @@ remove_method(VALUE klass, ID mid)
if (!st_lookup(RCLASS_M_TBL(klass), mid, &data) ||
!(me = (rb_method_entry_t *)data) ||
(!me->def || me->def->type == VM_METHOD_TYPE_UNDEF)) {
- rb_name_error(mid, "method `%s' not defined in %s",
- rb_id2name(mid), rb_class2name(klass));
+ rb_name_error(mid, "method `%"PRIsVALUE"' not defined in %"PRIsVALUE,
+ rb_id2str(mid), rb_class_path(klass));
}
key = (st_data_t)mid;
st_delete(RCLASS_M_TBL(klass), &key, &data);