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

yarv-diff:287

From: ko1 atdot.net
Date: 20 Feb 2006 07:35:08 -0000
Subject: [yarv-diff:287] r451 - in trunk: . ext/win32ole yarvtest

Author: ko1
Date: 2006-02-20 16:35:08 +0900 (Mon, 20 Feb 2006)
New Revision: 451

Modified:
   trunk/
   trunk/ChangeLog
   trunk/common.mk
   trunk/eval_intern.h
   trunk/eval_jump.h
   trunk/ext/win32ole/.document
   trunk/test.rb
   trunk/yarvtest/test_jump.rb
Log:
 r688@lermite:  ko1 | 2006-02-20 16:30:37 +0900
 	* common.mk : add a dependency to vm.c on eval_intern.h
 
 	* eval_intern.h : fix to initialize tag->tag
 
 	* yarvtest/test_jump.rb : add tests for above
 
 	* eval_jump.h : use local variable
 



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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/ChangeLog	2006-02-20 07:35:08 UTC (rev 451)
@@ -4,6 +4,17 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-02-20(Mon) 16:28:59 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* common.mk : add a dependency to vm.c on eval_intern.h
+
+	* eval_intern.h : fix to initialize tag->tag
+
+	* yarvtest/test_jump.rb : add tests for above
+
+	* eval_jump.h : use local variable
+
+
 2006-02-20(Mon) 15:13:24 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* benchmark/bm_vm3_thread_create_join.rb : added

Modified: trunk/common.mk
===================================================================
--- trunk/common.mk	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/common.mk	2006-02-20 07:35:08 UTC (rev 451)
@@ -377,7 +377,7 @@
 disasm.$(OBJEXT): {$(VPATH)}disasm.c {$(VPATH)}yarvcore.h {$(VPATH)}debug.h vm_opts.h
 vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}vm.h {$(VPATH)}insnhelper.h \
         {$(VPATH)}yarvcore.h {$(VPATH)}debug.h {$(VPATH)}vm_evalbody.h \
-        insns.inc vm.inc vmtc.inc vm_macro.inc vm_opts.h
+        insns.inc vm.inc vmtc.inc vm_macro.inc vm_opts.h {$(VPATH)}eval_intern.h
 vm_dump.$(OBJEXT): {$(VPATH)}yarvcore.h {$(VPATH)}vm.h
 yarvcore.$(OBJEXT): {$(VPATH)}yarvcore.c {$(VPATH)}yarvcore.h \
         {$(VPATH)}yarv_version.h {$(VPATH)}debug.h rev.inc

Modified: trunk/eval_intern.h
===================================================================
--- trunk/eval_intern.h	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/eval_intern.h	2006-02-20 07:35:08 UTC (rev 451)
@@ -191,6 +191,7 @@
 #define TH_PUSH_TAG(th) do { \
   struct yarv_tag _tag; \
   yarv_thread_t * const _th = th; \
+  _tag.tag = 0; \
   _tag.prev = _th->tag; \
   _th->tag = &_tag;
 

Modified: trunk/eval_jump.h
===================================================================
--- trunk/eval_jump.h	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/eval_jump.h	2006-02-20 07:35:08 UTC (rev 451)
@@ -107,7 +107,7 @@
 	val = rb_yield_0(tag, 0, 0, 0, Qfalse);
     }
     else if (state == TAG_THROW && th->errinfo == tag) {
-	val = GET_THREAD()->tag->retval;
+	val = th->tag->retval;
 	th->errinfo = 0;
 	state = 0;
     }

Modified: trunk/ext/win32ole/.document
===================================================================
--- trunk/ext/win32ole/.document	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/ext/win32ole/.document	2006-02-20 07:35:08 UTC (rev 451)
@@ -0,0 +1 @@
+win32ole.c

Modified: trunk/test.rb
===================================================================
--- trunk/test.rb	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/test.rb	2006-02-20 07:35:08 UTC (rev 451)
@@ -1,3 +1,32 @@
+for d,*f in [[1,2,3]]; p d,f; end
+__END__
+def method_missing(m,&b) b end; p f{}
+
+__END__
+class Object; define_method(:foo){|*args|  p args}; end; 0.foo(1,2,3)
+
+__END__
+[[1,2,3]].map{|a,b| p [a,b]}
+__END__
+
+p catch(:foo){
+  1.times{
+    throw :foo
+  }
+}
+p catch(:foo){
+  throw :foo, false
+}
+p catch(:foo){
+  throw :foo, nil
+}
+p catch(:foo){
+  throw :foo, :ok
+}
+
+
+__END__
+
 ary = ['123']
 
 if target = ary.shift and /^[a-z-]+$/ =~ target

Modified: trunk/yarvtest/test_jump.rb
===================================================================
--- trunk/yarvtest/test_jump.rb	2006-02-20 06:16:38 UTC (rev 450)
+++ trunk/yarvtest/test_jump.rb	2006-02-20 07:35:08 UTC (rev 451)
@@ -237,6 +237,60 @@
       }
     }
   end
-  
+
+  def test_catch_and_throw
+    ae %q{
+      catch(:foo){
+        throw :foo
+      }
+    }
+    ae %q{
+      catch(:foo){
+        throw :foo, false
+      }
+    }
+    ae %q{
+      catch(:foo){
+        throw :foo, nil
+      }
+    }
+    ae %q{
+      catch(:foo){
+        throw :foo, :ok
+      }
+    }
+    ae %q{
+      catch(:foo){
+        1.times{
+          throw :foo
+        }
+      }
+    }
+    ae %q{
+      catch(:foo){
+        1.times{
+          throw :foo, :ok
+        }
+      }
+    }
+    ae %q{
+      catch(:foo){
+        catch(:bar){
+          throw :foo, :ok
+        }
+        :ng
+      }
+    }
+    ae %q{
+      catch(:foo){
+        catch(:bar){
+          1.times{
+            throw :foo, :ok
+          }
+        }
+        :ng
+      }
+    }
+  end
 end
 


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

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