[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:238

From: ko1 atdot.net
Date: 13 Feb 2006 16:11:50 -0000
Subject: [yarv-diff:238] r400 - in trunk: . yarvtest

Author: ko1
Date: 2006-02-14 01:11:50 +0900 (Tue, 14 Feb 2006)
New Revision: 400

Modified:
   trunk/
   trunk/ChangeLog
   trunk/compile.c
   trunk/test.rb
   trunk/yarvtest/test_exception.rb
Log:
 r590@leremita:  ko1 | 2006-02-14 01:07:28 +0900
 	* compile.c : fix to avoid stack consistency error
 
 	* yarvtest/test_exception.rb : add a test for above
 



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:589
   + 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:590

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-02-13 16:11:08 UTC (rev 399)
+++ trunk/ChangeLog	2006-02-13 16:11:50 UTC (rev 400)
@@ -4,7 +4,13 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-02-14(Tue) 01:06:57 +0900  Koichi Sasada  <ko1 atdot.net>
 
+	* compile.c : fix to avoid stack consistency error
+
+	* yarvtest/test_exception.rb : add a test for above
+
+
 2006-02-14(Tue) 00:42:47 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* yarvcore.h, vm_macro.def : rename VM_CALL_SUPER to VM_CALL_SUPER_BIT

Modified: trunk/compile.c
===================================================================
--- trunk/compile.c	2006-02-13 16:11:08 UTC (rev 399)
+++ trunk/compile.c	2006-02-13 16:11:50 UTC (rev 400)
@@ -2901,6 +2901,9 @@
 	      add_ensure_iseq(ret, iseq);
 	      ADD_INSNL(ret, nd_line(node), jump,
 			iseq->compile_data->redo_label);
+	      if (!poped) { /* for stack consistency */
+		  ADD_INSN(ret, nd_line(node), putnil);
+	      }
 	  }
 	  else if (iseq->type == ISEQ_TYPE_EVAL) {
 	      COMPILE_ERROR(("Can't escape from eval with redo"));
@@ -2908,6 +2911,9 @@
 	  else if (iseq->compile_data->start_label) {
 	      ADD_INSNL(ret, nd_line(node), jump,
 			iseq->compile_data->start_label);
+	      if (!poped) { /* for stack consistency */
+		  ADD_INSN(ret, nd_line(node), putnil);
+	      }
 	  }
 	  else {
 	      yarv_iseq_t *ip = iseq->parent_iseq;

Modified: trunk/test.rb
===================================================================
--- trunk/test.rb	2006-02-13 16:11:08 UTC (rev 399)
+++ trunk/test.rb	2006-02-13 16:11:50 UTC (rev 400)
@@ -1,18 +1,21 @@
-
-class C
-  private
-  def m
-    p :OK
+1.times{
+  begin
+    raise
+    redo
+  rescue
   end
-end
+  p 1
+}
 
-class D < C
-  def m
-    super
+__END__
+proc do
+  begin
+    raise StandardError
+    redo
+  rescue StandardError
   end
-end
+end.call
 
-D.new.m
 
 __END__
 require 'timeout'

Modified: trunk/yarvtest/test_exception.rb
===================================================================
--- trunk/yarvtest/test_exception.rb	2006-02-13 16:11:08 UTC (rev 399)
+++ trunk/yarvtest/test_exception.rb	2006-02-13 16:11:50 UTC (rev 400)
@@ -394,6 +394,15 @@
         end
       }.call
     }
+    ae %q{
+      proc do
+        begin
+          raise StandardError
+          redo
+        rescue StandardError
+        end
+      end.call
+    }
   end
 end
 


-- 
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]