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
This commit is contained in:
rhe 2016-12-20 05:26:07 +00:00
parent 9ec0e8cb35
commit c54ede0560
3 changed files with 9 additions and 22 deletions

View file

@ -788,19 +788,13 @@ thread_initialize(VALUE thread, VALUE args)
}
GetThreadPtr(thread, th);
if (th->first_args) {
VALUE proc = th->first_proc, line, loc;
VALUE file;
VALUE proc = th->first_proc, loc;
if (!proc || !RTEST(loc = rb_proc_location(proc))) {
rb_raise(rb_eThreadError, "already initialized thread");
}
file = RARRAY_AREF(loc, 0);
if (NIL_P(line = RARRAY_AREF(loc, 1))) {
rb_raise(rb_eThreadError,
"already initialized thread - %"PRIsVALUE, file);
}
rb_raise(rb_eThreadError,
"already initialized thread - %"PRIsVALUE":%"PRIsVALUE,
file, line);
RARRAY_AREF(loc, 0), RARRAY_AREF(loc, 1));
}
return thread_create_core(thread, args, 0);
}