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

yarv-diff:343

From: ko1 atdot.net
Date: 5 Jul 2006 02:31:03 -0000
Subject: [yarv-diff:343] r509 - in trunk: . lib

Author: ko1
Date: 2006-07-05 11:31:01 +0900 (Wed, 05 Jul 2006)
New Revision: 509

Modified:
   trunk/
   trunk/ChangeLog
   trunk/lib/yasm.rb
   trunk/vm.c
   trunk/yarvcore.c
Log:
 r792@lermite:  ko1 | 2006-07-05 11:28:15 +0900
 	* lib/yasm.rb : fix method name
 
 	* vm.c (th_set_top_stack) : check toplevel or not
 



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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-07-04 11:06:34 UTC (rev 508)
+++ trunk/ChangeLog	2006-07-05 02:31:01 UTC (rev 509)
@@ -4,6 +4,13 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-07-05(Wed) 11:23:50 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* lib/yasm.rb : fix method name
+
+	* vm.c (th_set_top_stack) : check toplevel or not
+
+
 2006-07-04(Tue) 20:05:38 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* rb/compile.rb : added

Modified: trunk/lib/yasm.rb
===================================================================
--- trunk/lib/yasm.rb	2006-07-04 11:06:34 UTC (rev 508)
+++ trunk/lib/yasm.rb	2006-07-05 02:31:01 UTC (rev 509)
@@ -9,7 +9,7 @@
 module YARVCore
   class Assembler
     def self.simpledata_to_iseq sd
-      YARVCore::InstructionSequence.load_simpledata sd
+      YARVCore::InstructionSequence.load sd
     end
 
     def self.toplevel vars = [], &b
@@ -57,8 +57,8 @@
         @type = type
         @name = name
         @filename = filename
-        @args = args || []
-        @vars = vars || []
+        @vars = (args || []) + (vars || [])
+        @args = args.size
         @locals = args + vars + lopt
         @line = []
         @body = []
@@ -77,7 +77,7 @@
         #  type, args, vars, exception_table, body]
         ['YARVInstructionSimpledataFormat', 1, 1, 1, nil,
          @name, @filename, @line,
-         @type, @args, @vars, @exception, @body]
+         @type, @vars, @args, @exception, @body]
       end
 
       def method name, args=[], vars=[], &b
@@ -201,7 +201,7 @@
   leave
 }
 p iseq
-iseq.eval #=> 30
+iseq.eval #=> 30, 0, 1, 2
 
 ###########################################################
 

Modified: trunk/vm.c
===================================================================
--- trunk/vm.c	2006-07-04 11:06:34 UTC (rev 508)
+++ trunk/vm.c	2006-07-05 02:31:01 UTC (rev 509)
@@ -160,6 +160,10 @@
     yarv_iseq_t *iseq;
     GetISeqVal(iseqval, iseq);
 
+    if (iseq->type != ISEQ_TYPE_TOP) {
+	rb_raise(rb_eTypeError, "Not a toplevel Instruction Sequence");
+    }
+
     /* for return */
     th_set_finish_env(th);
 

Modified: trunk/yarvcore.c
===================================================================
--- trunk/yarvcore.c	2006-07-04 11:06:34 UTC (rev 508)
+++ trunk/yarvcore.c	2006-07-05 02:31:01 UTC (rev 509)
@@ -796,6 +796,7 @@
 th_eval(yarv_thread_t *th, VALUE iseq)
 {
     VALUE val;
+    
     th_set_top_stack(th, iseq);
 
     if (!rb_const_defined(rb_cObject, rb_intern("TOPLEVEL_BINDING"))) {


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

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