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

ruby-changes:13490

From: mame <ko1@a...>
Date: Fri, 9 Oct 2009 01:11:53 +0900 (JST)
Subject: [ruby-changes:13490] Ruby:r25266 (trunk): * compile.c (ADD_TRACE): fire coverage event in ensure clause.

mame	2009-10-09 01:11:30 +0900 (Fri, 09 Oct 2009)

  New Revision: 25266

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25266

  Log:
    * compile.c (ADD_TRACE): fire coverage event in ensure clause.
      [ruby-dev:39303]
    
    * iseq.h, iseq.c: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/iseq.c
    trunk/iseq.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25265)
+++ ChangeLog	(revision 25266)
@@ -1,3 +1,10 @@
+Fri Oct  9 01:07:34 2009  Yusuke Endoh  <mame@t...>
+
+	* compile.c (ADD_TRACE): fire coverage event in ensure clause.
+	  [ruby-dev:39303]
+
+	* iseq.h, iseq.c: ditto.
+
 Fri Oct  9 00:33:29 2009  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/net/telnet.rb (cmd): Pass FailEOF options: patch by Brian
Index: iseq.c
===================================================================
--- iseq.c	(revision 25265)
+++ iseq.c	(revision 25266)
@@ -249,6 +249,7 @@
     iseq->compile_data->storage_head->buff =
       (char *)(&iseq->compile_data->storage_head->buff + 1);
     iseq->compile_data->option = option;
+    iseq->compile_data->last_coverable_line = -1;
 
     set_relation(iseq, parent);
 
Index: iseq.h
===================================================================
--- iseq.h	(revision 25265)
+++ iseq.h	(revision 25266)
@@ -82,6 +82,7 @@
     struct iseq_compile_data_storage *storage_head;
     struct iseq_compile_data_storage *storage_current;
     int last_line;
+    int last_coverable_line;
     int flip_cnt;
     int label_no;
     int node_level;
Index: compile.c
===================================================================
--- compile.c	(revision 25265)
+++ compile.c	(revision 25266)
@@ -223,8 +223,9 @@
 #define ADD_TRACE(seq, line, event) \
   do { \
       if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
-	  RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
+	  (line) != iseq->compile_data->last_coverable_line) { \
 	  RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+	  iseq->compile_data->last_coverable_line = (line); \
 	  ADD_INSN1(seq, line, trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
       } \
       if (iseq->compile_data->option->trace_instruction) { \

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

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