aboutsummaryrefslogtreecommitdiffstats
path: root/proc.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 /proc.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 'proc.c')
-rw-r--r--proc.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/proc.c b/proc.c
index d72e1a9254..1cc36a083c 100644
--- a/proc.c
+++ b/proc.c
@@ -1076,12 +1076,8 @@ iseq_location(const rb_iseq_t *iseq)
if (!iseq) return Qnil;
rb_iseq_check(iseq);
loc[0] = iseq->body->location.path;
- if (iseq->body->line_info_table) {
- loc[1] = rb_iseq_first_lineno(iseq);
- }
- else {
- loc[1] = Qnil;
- }
+ loc[1] = iseq->body->location.first_lineno;
+
return rb_ary_new4(2, loc);
}
@@ -1234,12 +1230,9 @@ proc_to_s_(VALUE self, const rb_proc_t *proc)
case block_type_iseq:
{
const rb_iseq_t *iseq = rb_iseq_check(block->as.captured.code.iseq);
- int first_lineno = 0;
- if (iseq->body->line_info_table) {
- first_lineno = FIX2INT(rb_iseq_first_lineno(iseq));
- }
str = rb_sprintf("#<%s:%p@%"PRIsVALUE":%d%s>", cname, (void *)self,
- iseq->body->location.path, first_lineno, is_lambda);
+ iseq->body->location.path,
+ FIX2INT(iseq->body->location.first_lineno), is_lambda);
}
break;
case block_type_symbol: