[前][次][番号順一覧][スレッド一覧]

ruby-changes:43844

From: nagachika <ko1@a...>
Date: Tue, 16 Aug 2016 12:00:48 +0900 (JST)
Subject: [ruby-changes:43844] nagachika:r55917 (ruby_2_3): merge revision(s) 53424, 55509: [Backport #12517]

nagachika	2016-08-16 12:00:20 +0900 (Tue, 16 Aug 2016)

  New Revision: 55917

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55917

  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_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/compile.c
    branches/ruby_2_3/parse.y
    branches/ruby_2_3/test/coverage/test_coverage.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/test/coverage/test_coverage.rb
===================================================================
--- ruby_2_3/test/coverage/test_coverage.rb	(revision 55916)
+++ ruby_2_3/test/coverage/test_coverage.rb	(revision 55917)
@@ -111,4 +111,13 @@ class TestCoverage < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/coverage/test_coverage.rb#L111
   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_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 55916)
+++ ruby_2_3/ChangeLog	(revision 55917)
@@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Aug 16 11:51:52 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 11:51:52 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 11:46:07 2016  NARUSE, Yui  <naruse@r...>
 
 	* lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
Index: ruby_2_3/compile.c
===================================================================
--- ruby_2_3/compile.c	(revision 55916)
+++ ruby_2_3/compile.c	(revision 55917)
@@ -252,6 +252,7 @@ r_value(VALUE value) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/compile.c#L252
 #define ADD_TRACE(seq, line, event) \
   do { \
       if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
+	  (line) > 0 && \
 	  (line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
 	  RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
 	  ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 55916)
+++ ruby_2_3/version.h	(revision 55917)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
 #define RUBY_RELEASE_DATE "2016-08-16"
-#define RUBY_PATCHLEVEL 164
+#define RUBY_PATCHLEVEL 165
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_3/parse.y
===================================================================
--- ruby_2_3/parse.y	(revision 55916)
+++ ruby_2_3/parse.y	(revision 55917)
@@ -5495,7 +5495,7 @@ coverage(VALUE fname, int n) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/parse.y#L5495
 {
     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;
     }

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53424,55509


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]