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

ruby-changes:3131

From: ko1@a...
Date: 25 Dec 2007 02:41:55 +0900
Subject: [ruby-changes:3131] ko1 - Ruby:r14623 (trunk): * compile.c (iseq_compile_each): add a "pop" insn after break

ko1	2007-12-25 02:41:29 +0900 (Tue, 25 Dec 2007)

  New Revision: 14623

  Modified files:
    trunk/ChangeLog
    trunk/bootstraptest/test_knownbug.rb
    trunk/bootstraptest/test_syntax.rb
    trunk/compile.c

  Log:
    * compile.c (iseq_compile_each): add a "pop" insn after break
      to fix stack consistency error.  [ruby-core:14385]
    * bootstraptest/test_syntax.rb: add tests for above.
    * bootstraptest/test_knownbug.rb: remove fixed bug.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=14623&r2=14622
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14623&r2=14622
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_syntax.rb?r1=14623&r2=14622
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=14623&r2=14622

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14622)
+++ ChangeLog	(revision 14623)
@@ -1,3 +1,12 @@
+Tue Dec 25 02:15:39 2007  Koichi Sasada  <ko1@a...>
+
+	* compile.c (iseq_compile_each): add a "pop" insn after break
+	  to fix stack consistency error.  [ruby-core:14385]
+
+	* bootstraptest/test_syntax.rb: add tests for above.
+
+	* bootstraptest/test_knownbug.rb: remove fixed bug.
+
 Tue Dec 25 01:54:36 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* id.c (Init_id): remove several unused symbols. [ruby-core:14362]
Index: bootstraptest/test_syntax.rb
===================================================================
--- bootstraptest/test_syntax.rb	(revision 14622)
+++ bootstraptest/test_syntax.rb	(revision 14623)
@@ -662,3 +662,22 @@
   foo
 }
 
+assert_equal 'ok', %q{
+  counter = 2
+  while true
+    counter -= 1
+    next if counter != 0
+    break
+  end
+  :ok
+}, '[ruby-core:14385]'
+
+assert_equal 'ok', %q{
+  counter = 2
+  while true
+    counter -= 1
+    next if counter != 0
+    break :ok
+  end # direct
+}, '[ruby-core:14385]'
+
Index: bootstraptest/test_knownbug.rb
===================================================================
--- bootstraptest/test_knownbug.rb	(revision 14622)
+++ bootstraptest/test_knownbug.rb	(revision 14623)
@@ -2,12 +2,3 @@
 # This test file concludes tests which point out known bugs.
 # So all tests will cause failure.
 #
-
-assert_normal_exit %q{
-  counter = 2
-  while true
-    counter -= 1
-    next if counter != 0
-    break
-  end
-}, '[ruby-core:14385]'
Index: compile.c
===================================================================
--- compile.c	(revision 14622)
+++ compile.c	(revision 14623)
@@ -2928,6 +2928,7 @@
 		     iseq->compile_data->loopval_popped);
 	    ADD_INSNL(ret, nd_line(node), jump,
 		      iseq->compile_data->end_label);
+	    ADD_INSN(ret, nd_line(node), pop);
 	}
 	else if (iseq->type == ISEQ_TYPE_BLOCK) {
 	  break_by_insn:

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

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