diff options
author | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-20 05:26:07 +0000 |
---|---|---|
committer | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-20 05:26:07 +0000 |
commit | c54ede0560be7e57b90b063fcddab402f4f29cd3 (patch) | |
tree | 3a08922be9709cbf10d21276d12839fdafef5cd4 /thread.c | |
parent | 9ec0e8cb35c06a87b098dbbfe5f9a979ddd646e9 (diff) |
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 'thread.c')
-rw-r--r-- | thread.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -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); } |