ruby-changes:43870
From: usa <ko1@a...>
Date: Tue, 16 Aug 2016 21:14:47 +0900 (JST)
Subject: [ruby-changes:43870] usa:r55943 (ruby_2_2): merge revision(s) 53424, 55509: [Backport #12517]
usa 2016-08-16 21:14:41 +0900 (Tue, 16 Aug 2016) New Revision: 55943 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55943 Log: merge revision(s) 53424,55509: [Backport #12517] * test/coverage/test_coverage.rb: ignored test when enabled to coverage. It lead to crash with `make test-all`. * compile.c (ADD_TRACE): ignore trace instruction on non-positive line. * parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/compile.c branches/ruby_2_2/parse.y branches/ruby_2_2/test/coverage/test_coverage.rb branches/ruby_2_2/version.h Index: ruby_2_2/parse.y =================================================================== --- ruby_2_2/parse.y (revision 55942) +++ ruby_2_2/parse.y (revision 55943) @@ -5454,7 +5454,7 @@ coverage(VALUE fname, int n) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/parse.y#L5454 { VALUE coverages = rb_get_coverages(); if (RTEST(coverages) && RBASIC(coverages)->klass == 0) { - VALUE lines = rb_ary_tmp_new_fill(n); + VALUE lines = n > 0 ? rb_ary_tmp_new_fill(n) : rb_ary_tmp_new(0); rb_hash_aset(coverages, fname, lines); return lines; } Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 55942) +++ ruby_2_2/ChangeLog (revision 55943) @@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Tue Aug 16 21:12:07 2016 Nobuyoshi Nakada <nobu@r...> + + * compile.c (ADD_TRACE): ignore trace instruction on non-positive + line. + + * parse.y (coverage): get rid of ArgumentError when the starting + line number is not positive. [ruby-core:76141] [Bug #12517] + +Tue Aug 16 21:12:07 2016 SHIBATA Hiroshi <hsbt@r...> + + * test/coverage/test_coverage.rb: ignored test when enabled to coverage. + It lead to crash with `make test-all`. + Tue Aug 16 21:01:55 2016 NARUSE, Yui <naruse@r...> * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque Index: ruby_2_2/compile.c =================================================================== --- ruby_2_2/compile.c (revision 55942) +++ ruby_2_2/compile.c (revision 55943) @@ -245,6 +245,7 @@ r_value(VALUE value) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/compile.c#L245 #define ADD_TRACE(seq, line, event) \ do { \ if ((event) == RUBY_EVENT_LINE && iseq->coverage && \ + (line) > 0 && \ (line) != iseq->compile_data->last_coverable_line) { \ RARRAY_ASET(iseq->coverage, (line) - 1, INT2FIX(0)); \ iseq->compile_data->last_coverable_line = (line); \ Index: ruby_2_2/test/coverage/test_coverage.rb =================================================================== --- ruby_2_2/test/coverage/test_coverage.rb (revision 55942) +++ ruby_2_2/test/coverage/test_coverage.rb (revision 55943) @@ -61,4 +61,13 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/coverage/test_coverage.rb#L61 ensure $".replace loaded_features end -end + + def test_nonpositive_linenumber + bug12517 = '[ruby-core:76141] [Bug #12517]' + Coverage.start + assert_nothing_raised(ArgumentError, bug12517) do + RubyVM::InstructionSequence.compile(":ok", nil, "<compiled>", 0) + end + assert_include Coverage.result, "<compiled>" + end +end unless ENV['COVERAGE'] Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 55942) +++ ruby_2_2/version.h (revision 55943) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-08-16" -#define RUBY_PATCHLEVEL 368 +#define RUBY_PATCHLEVEL 369 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 8 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53424,55509 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/