diff options
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/vm_method.c b/vm_method.c index 5ca302a86a..4cf03fafde 100644 --- a/vm_method.c +++ b/vm_method.c @@ -31,7 +31,6 @@ vm_ccs_dump_i(ID mid, VALUE val, void *data) rp(ccs->cme); for (int i=0; i<ccs->len; i++) { - fprintf(stderr, " | [%d]\t", i); vm_ci_dump(ccs->entries[i].ci); rp_m( " | \t", ccs->entries[i].cc); } @@ -428,7 +427,6 @@ rb_vm_ci_lookup(ID mid, unsigned int flag, unsigned int argc, const struct rb_ca RB_VM_LOCK_LEAVE(); VM_ASSERT(ci); - VM_ASSERT(vm_ci_markable(ci)); return ci; } @@ -1016,7 +1014,6 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil old_def->type != VM_METHOD_TYPE_ALIAS) { const rb_iseq_t *iseq = 0; - rb_warning("method redefined; discarding old %"PRIsVALUE, rb_id2str(mid)); switch (old_def->type) { case VM_METHOD_TYPE_ISEQ: iseq = def_iseq_ptr(old_def); @@ -1028,10 +1025,16 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil break; } if (iseq) { - rb_compile_warning(RSTRING_PTR(rb_iseq_path(iseq)), - ISEQ_BODY(iseq)->location.first_lineno, - "previous definition of %"PRIsVALUE" was here", - rb_id2str(old_def->original_id)); + rb_warning( + "method redefined; discarding old %"PRIsVALUE"\n%s:%d: warning: previous definition of %"PRIsVALUE" was here", + rb_id2str(mid), + RSTRING_PTR(rb_iseq_path(iseq)), + ISEQ_BODY(iseq)->location.first_lineno, + rb_id2str(old_def->original_id) + ); + } + else { + rb_warning("method redefined; discarding old %"PRIsVALUE, rb_id2str(mid)); } } } @@ -1247,6 +1250,7 @@ method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *me, me->def->type, me->def, 0, NULL); if (newme == me) { me->def->no_redef_warning = TRUE; + METHOD_ENTRY_FLAGS_SET(newme, visi, FALSE); } method_added(klass, mid); |