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

ruby-changes:8086

From: mame <ko1@a...>
Date: Sun, 28 Sep 2008 22:15:52 +0900 (JST)
Subject: [ruby-changes:8086] Ruby:r19612 (trunk): * compile.c (iseq_set_sequence): check duplicated when clauses.

mame	2008-09-28 22:15:34 +0900 (Sun, 28 Sep 2008)

  New Revision: 19612

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

  Log:
    * compile.c (iseq_set_sequence): check duplicated when clauses.
      [ruby-dev:36616]

  Modified files:
    trunk/ChangeLog
    trunk/compile.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19611)
+++ ChangeLog	(revision 19612)
@@ -1,3 +1,8 @@
+Sun Sep 28 22:05:07 2008  Yusuke Endoh  <mame@t...>
+
+	* compile.c (iseq_set_sequence): check duplicated when clause.
+	  [ruby-dev:36616]
+
 Sun Sep 28 19:04:03 2008  Tadayoshi Funaba  <tadf@d...>
 
 	* test/date/*.rb: imported a date test suite ruby 1.9 limited ed.
Index: compile.c
===================================================================
--- compile.c	(revision 19611)
+++ compile.c	(revision 19612)
@@ -1349,7 +1349,12 @@
 				    rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
 						     "unknown label");
 				}
-				rb_hash_aset(map, obj, INT2FIX(lobj->position - (pos+len)));
+				if (!st_lookup(rb_hash_tbl(map), obj, 0)) {
+				    rb_hash_aset(map, obj, INT2FIX(lobj->position - (pos+len)));
+				}
+				else {
+				    rb_warning("duplicated when clause is ignored");
+				}
 			    }
 			    generated_iseq[pos + 1 + j] = map;
 			    iseq_add_mark_object(iseq, map);

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

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