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

ruby-changes:15522

From: mame <ko1@a...>
Date: Wed, 21 Apr 2010 00:29:26 +0900 (JST)
Subject: [ruby-changes:15522] Ruby:r27424 (trunk): * compile.c (NODE_NEXT, NODE_REDO): add dummy putnil instruction to

mame	2010-04-21 00:28:33 +0900 (Wed, 21 Apr 2010)

  New Revision: 27424

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

  Log:
    * compile.c (NODE_NEXT, NODE_REDO): add dummy putnil instruction to
      fix stack consistency error.  [ruby-core:28172]
    
    * bootstraptest/test_jump.rb: add a test for above.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27423)
+++ ChangeLog	(revision 27424)
@@ -1,3 +1,10 @@
+Wed Apr 21 00:26:17 2010  Yusuke Endoh  <mame@t...>
+
+	* compile.c (NODE_NEXT, NODE_REDO): add dummy putnil instruction to
+	  fix stack consistency error.  [ruby-core:28172]
+
+	* bootstraptest/test_jump.rb: add a test for above.
+
 Wed Apr 21 00:16:44 2010  Yusuke Endoh  <mame@t...>
 
 	* ext/zlib/zlib.c (rb_deflate_params): update buf_filled count because
Index: bootstraptest/test_jump.rb
===================================================================
--- bootstraptest/test_jump.rb	(revision 27423)
+++ bootstraptest/test_jump.rb	(revision 27424)
@@ -271,3 +271,14 @@
     end
   end.call
 }
+
+assert_normal_exit %q{
+  while true
+    begin
+      raise
+      next
+    rescue
+    end
+    break
+  end
+}, '[ruby-core:28172]'
Index: compile.c
===================================================================
--- compile.c	(revision 27423)
+++ compile.c	(revision 27424)
@@ -3359,6 +3359,9 @@
 	    ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
 	    ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
 	    ADD_ADJUST_RESTORE(ret, splabel);
+	    if (!poped) {
+		ADD_INSN(ret, nd_line(node), putnil);
+	    }
 	}
 	else if (iseq->compile_data->end_label) {
 	    LABEL *splabel = NEW_LABEL(0);
@@ -3424,6 +3427,9 @@
 	    add_ensure_iseq(ret, iseq, 0);
 	    ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->redo_label);
 	    ADD_ADJUST_RESTORE(ret, splabel);
+	    if (!poped) {
+		ADD_INSN(ret, nd_line(node), putnil);
+	    }
 	}
 	else if (iseq->type == ISEQ_TYPE_EVAL) {
 	  redo_in_eval:

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

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