diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-11-12 23:14:15 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-11-20 22:11:38 +0900 |
commit | 79f87024ee9d0f264c0ab81d0a89e889ab9fde43 (patch) | |
tree | c1c4f7d4185c864498c8de6924b0d0bb4acdbd5a /COPYING | |
parent | 6915b8aeb73b843bf623484597520e95b5b572b7 (diff) | |
download | ruby-wip-topic/thread-fix-start-with-empty-iseq.tar.gz |
proc.c: assume rb_iseq_location_t::first_lineno is always availablewip-topic/thread-fix-start-with-empty-iseq
rb_iseq_location_t::first_lineno (typically referenced as
iseq->body->location.first_lineno, where iseq is an rb_iseq_t *) can
always be assumed to contain a Fixnum regardless of whether struct
rb_iseq_constant_body::line_info_table (likewise,
iseq->body->line_info_table) is NULL or non-NULL.
This fixes TypeError on starting a new thread with an empty Proc with
trace instructions disabled. The TypeError comes from thread_pthread.c,
in native_set_thread_name(), where it expects the line number returned
from rb_proc_location(). The number can be nil if the line_info_table is
NULL. The check seems to be the remains from the days before the
dedicated 'first_lineno' field was introduced. So remove it.
This also modifies two other places, Proc#to_s and method redefinition
code, in the same way.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions