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

ruby-changes:50365

From: naruse <ko1@a...>
Date: Mon, 19 Feb 2018 15:33:06 +0900 (JST)
Subject: [ruby-changes:50365] naruse:r62481 (ruby_2_5): merge revision(s) 61711:

naruse	2018-02-19 15:33:01 +0900 (Mon, 19 Feb 2018)

  New Revision: 62481

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

  Log:
    merge revision(s) 61711:
    
    compile.c (iseq_compile_each0): remove irrelevant tracecoverage
    
    This change removes tracecoverage instructions on a line that has any
    NODE but is non-significant, such as, just one literal.
    
    This fixes the following failure that occurs only when coverage is
    enabled:
    
      1) Failure:
    TestISeq#test_to_a_lines [.../ruby/test/ruby/test_iseq.rb:56]:
    <[3, 4, 7, 9]> expected but was
    <[3, 4, 5, 6, 7, 8, 9]>.

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/compile.c
    branches/ruby_2_5/version.h
Index: ruby_2_5/version.h
===================================================================
--- ruby_2_5/version.h	(revision 62480)
+++ ruby_2_5/version.h	(revision 62481)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1
 #define RUBY_VERSION "2.5.0"
-#define RUBY_RELEASE_DATE "2018-02-18"
-#define RUBY_PATCHLEVEL 21
+#define RUBY_RELEASE_DATE "2018-02-19"
+#define RUBY_PATCHLEVEL 22
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_DAY 19
 
 #include "ruby/version.h"
 
Index: ruby_2_5/compile.c
===================================================================
--- ruby_2_5/compile.c	(revision 62480)
+++ ruby_2_5/compile.c	(revision 62481)
@@ -7093,6 +7093,18 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/ruby_2_5/compile.c#L7093
 	return COMPILE_NG;
     }
 
+    /* remove tracecoverage instruction if there is no relevant instruction */
+    if (IS_TRACE(ret->last) && ((TRACE*) ret->last)->event == RUBY_EVENT_LINE) {
+	LINK_ELEMENT *insn = ret->last->prev;
+	if (IS_INSN(insn) &&
+	    IS_INSN_ID(insn, tracecoverage) &&
+	    FIX2LONG(OPERAND_AT(insn, 0)) == RUBY_EVENT_COVERAGE_LINE
+	) {
+	    ELEM_REMOVE(insn); /* remove tracecovearge */
+	    RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line - 1, Qnil);
+	}
+    }
+
     debug_node_end();
     return COMPILE_OK;
 }
Index: ruby_2_5
===================================================================
--- ruby_2_5	(revision 62480)
+++ ruby_2_5	(revision 62481)

Property changes on: ruby_2_5
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r61711

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

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