зеркало из https://github.com/github/ruby.git
thread.c: check coverage values
* thread.c (update_coverage): check coverage values, and ignore non-fixnum values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
20e7f819aa
Коммит
dd3b3d716e
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 6 10:30:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (update_coverage): check coverage values, and ignore
|
||||
non-fixnum values.
|
||||
|
||||
Thu Oct 6 09:19:21 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (fptr_finalize): use dedicated macro RB_INTEGER_TYPE_P.
|
||||
|
|
5
thread.c
5
thread.c
|
@ -4940,10 +4940,13 @@ update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas
|
|||
if (RB_TYPE_P(coverage, T_ARRAY) && !RBASIC_CLASS(coverage)) {
|
||||
long line = rb_sourceline() - 1;
|
||||
long count;
|
||||
VALUE num;
|
||||
if (line >= RARRAY_LEN(coverage)) { /* no longer tracked */
|
||||
return;
|
||||
}
|
||||
count = FIX2LONG(RARRAY_AREF(coverage, line)) + 1;
|
||||
num = RARRAY_AREF(coverage, line);
|
||||
if (!FIXNUM_P(num)) return;
|
||||
count = FIX2LONG(num) + 1;
|
||||
if (POSFIXABLE(count)) {
|
||||
RARRAY_ASET(coverage, line, LONG2FIX(count));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче