mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02: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_2@54680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
658cd0871e
commit
aef285f5df
4 changed files with 10 additions and 2 deletions
2
thread.c
2
thread.c
|
@ -5181,7 +5181,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue