ruby-changes:42606
From: usa <ko1@a...>
Date: Fri, 22 Apr 2016 14:12:52 +0900 (JST)
Subject: [ruby-changes:42606] usa:r54680 (ruby_2_2): merge revision(s) 54465: [Backport #12237]
usa 2016-04-22 15:09:28 +0900 (Fri, 22 Apr 2016) New Revision: 54680 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54680 Log: merge revision(s) 54465: [Backport #12237] * thread.c (update_coverage): Do not track coverage in loaded files after Coverage.result. Avoids out-of-bounds access. [Bug #12237] * ext/coverage/coverage.c (coverage_clear_result_i): document. Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/ext/coverage/coverage.c branches/ruby_2_2/thread.c branches/ruby_2_2/version.h Index: ruby_2_2/ext/coverage/coverage.c =================================================================== --- ruby_2_2/ext/coverage/coverage.c (revision 54679) +++ ruby_2_2/ext/coverage/coverage.c (revision 54680) @@ -32,6 +32,7 @@ rb_coverage_start(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/coverage/coverage.c#L32 return Qnil; } +/* Make coverage arrays empty so old covered files are no longer tracked. */ static int coverage_result_i(st_data_t key, st_data_t val, st_data_t h) { Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 54679) +++ ruby_2_2/version.h (revision 54680) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.5" #define RUBY_RELEASE_DATE "2016-04-22" -#define RUBY_PATCHLEVEL 299 +#define RUBY_PATCHLEVEL 300 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 4 Index: ruby_2_2/thread.c =================================================================== --- ruby_2_2/thread.c (revision 54679) +++ ruby_2_2/thread.c (revision 54680) @@ -5181,7 +5181,7 @@ update_coverage(rb_event_flag_t event, V https://github.com/ruby/ruby/blob/trunk/ruby_2_2/thread.c#L5181 if (coverage && RBASIC(coverage)->klass == 0) { long line = rb_sourceline() - 1; long count; - if (RARRAY_AREF(coverage, line) == Qnil) { + if (line >= RARRAY_LEN(coverage)) { /* no longer tracked */ return; } count = FIX2LONG(RARRAY_AREF(coverage, line)) + 1; Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 54679) +++ ruby_2_2/ChangeLog (revision 54680) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Fri Apr 22 15:08:27 2016 Benoit Daloze <eregontp@g...> + + * thread.c (update_coverage): Do not track coverage in loaded files + after Coverage.result. Avoids out-of-bounds access. [Bug #12237] + + * ext/coverage/coverage.c (coverage_clear_result_i): document. + Fri Apr 22 14:56:46 2016 Nobuyoshi Nakada <nobu@r...> * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r54465 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/