aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-20 05:26:07 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-20 05:26:07 +0000
commit0c44fc2bc0b9bcac022effce53f7fcb7f1bb5af2 (patch)
tree3a08922be9709cbf10d21276d12839fdafef5cd4 /vm_method.c
parent2cf5517d31f87c65cc26012c503fed90b74055ba (diff)
downloadruby-0c44fc2bc0b9bcac022effce53f7fcb7f1bb5af2.tar.gz
proc.c: assume rb_iseq_location_t::first_lineno is always a Fixnum
Do not check for the value of rb_iseq_constant_body::line_info_table as it is no longer related. The checks seem to be the remains from the day before the dedicated 'first_lineno' field was introduced. Remove them. Note, rb_iseq_constant_body::line_info_table can be NULL only when the iseq does not contain any instructions that originate from Ruby code, for example, an iseq created with 'proc {}' under a non-default compile options where trace instructions are disabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_method.c b/vm_method.c
index 33e90cf9f1..8aea9b54cc 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -563,9 +563,9 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil
default:
break;
}
- if (iseq && !NIL_P(iseq->body->location.path)) {
- int line = iseq->body->line_info_table ? FIX2INT(rb_iseq_first_lineno(iseq)) : 0;
- rb_compile_warning(RSTRING_PTR(iseq->body->location.path), line,
+ if (iseq) {
+ rb_compile_warning(RSTRING_PTR(iseq->body->location.path),
+ FIX2INT(iseq->body->location.first_lineno),
"previous definition of %"PRIsVALUE" was here",
rb_id2str(old_def->original_id));
}