mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e30b44a09
commit
1b327a0804
4 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
Mon Apr 18 16:56:31 2016 Benoit Daloze <eregontp@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
Mon Apr 18 16:33:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
|
||||
|
|
|
@ -32,6 +32,7 @@ rb_coverage_start(VALUE klass)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
/* Make coverage arrays empty so old covered files are no longer tracked. */
|
||||
static int
|
||||
coverage_clear_result_i(st_data_t key, st_data_t val, st_data_t h)
|
||||
{
|
||||
|
|
2
thread.c
2
thread.c
|
@ -4768,7 +4768,7 @@ update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas
|
|||
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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.3.0"
|
||||
#define RUBY_RELEASE_DATE "2016-04-18"
|
||||
#define RUBY_PATCHLEVEL 87
|
||||
#define RUBY_PATCHLEVEL 88
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2016
|
||||
#define RUBY_RELEASE_MONTH 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue