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

ruby-changes:3151

From: ko1@a...
Date: 25 Dec 2007 11:24:56 +0900
Subject: [ruby-changes:3151] ko1 - Ruby:r14643 (trunk): * compile.c (iseq_compile_each): fix stack consistency error.

ko1	2007-12-25 11:24:12 +0900 (Tue, 25 Dec 2007)

  New Revision: 14643

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

  Log:
    * compile.c (iseq_compile_each): fix stack consistency error.
      a patch from Yusuke ENDOH <mame AT tsg.ne.jp>  [ruby-dev:32720]
    * bootstraptest/test_syntax.rb: add 2 tests for above.
    


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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14642)
+++ ChangeLog	(revision 14643)
@@ -1,3 +1,10 @@
+Tue Dec 25 11:20:38 2007  Koichi Sasada  <ko1@a...>
+
+	* compile.c (iseq_compile_each): fix stack consistency error.
+	  a patch from Yusuke ENDOH <mame AT tsg.ne.jp>  [ruby-dev:32720]
+
+	* bootstraptest/test_syntax.rb: add 2 tests for above.
+
 Tue Dec 25 11:14:20 2007  Koichi Sasada  <ko1@a...>
 
 	* iseq.c, vm_core.h: comment out unused fields.
Index: bootstraptest/test_syntax.rb
===================================================================
--- bootstraptest/test_syntax.rb	(revision 14642)
+++ bootstraptest/test_syntax.rb	(revision 14643)
@@ -690,3 +690,25 @@
   end
   :ok
 }
+
+assert_equal 'ok', %q{
+  counter = 2
+  while true
+    counter -= 1
+    break if counter == 0
+    next 
+    redo
+  end
+  :ok
+}
+
+assert_equal 'ok', %q{
+  counter = 2
+  while true
+    counter -= 1
+    break if counter == 0
+    next 
+    "#{ redo }"
+  end
+  :ok
+}
Index: compile.c
===================================================================
--- compile.c	(revision 14642)
+++ compile.c	(revision 14643)
@@ -3027,7 +3027,7 @@
 	if (iseq->compile_data->redo_label) {
 	    debugs("redo in while");
 #if 1
-	    pop_after_throw = 1;
+	    pop_after_throw = poped;
 	    goto redo_by_throw;
 #else
 	    add_ensure_iseq(ret, iseq);
@@ -3070,6 +3070,7 @@
 		ip = ip->parent_iseq;
 	    }
 	    if (ip != 0) {
+		ADD_INSN(ret, nd_line(node), putnil);
 		ADD_INSN1(ret, nd_line(node), throw,
 			  INT2FIX(level | 0x05) /* TAG_REDO */ );
 

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

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