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

ruby-changes:40890

From: ko1 <ko1@a...>
Date: Wed, 9 Dec 2015 00:30:57 +0900 (JST)
Subject: [ruby-changes:40890] ko1:r52969 (trunk): * compile.c (iseq_ibf_dump): dump extra data just string length.

ko1	2015-12-09 00:30:46 +0900 (Wed, 09 Dec 2015)

  New Revision: 52969

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

  Log:
    * compile.c (iseq_ibf_dump): dump extra data just string length.
    
    * sample/iseq_loader.rb: add using
      RubyVM::InstructionSequence.from_binary_format_extra_data method
      (commented out).

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/sample/iseq_loader.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52968)
+++ ChangeLog	(revision 52969)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec  9 00:24:33 2015  Koichi Sasada  <ko1@a...>
+
+	* compile.c (iseq_ibf_dump): dump extra data just string length.
+
+	* sample/iseq_loader.rb: add using
+	  RubyVM::InstructionSequence.from_binary_format_extra_data method
+	  (commented out).
+
 Mon Dec  9 00:21:19 2015  Yuki Nishijima  <mail@y...>
 
 	* gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.rc1
Index: sample/iseq_loader.rb
===================================================================
--- sample/iseq_loader.rb	(revision 52968)
+++ sample/iseq_loader.rb	(revision 52969)
@@ -70,7 +70,10 @@ class RubyVM::InstructionSequence https://github.com/ruby/ruby/blob/trunk/sample/iseq_loader.rb#L70
         $ISEQ_LOADER_LOADED += 1
         STDERR.puts "[ISEQ_LOADER] #{Process.pid} load #{fname} from #{iseq_key}" if COMPILE_DEBUG
         binary = read_compiled_iseq(fname, iseq_key)
-        RubyVM::InstructionSequence.from_binary_format(binary)
+        iseq = RubyVM::InstructionSequence.from_binary_format(binary)
+        # p [extra_data(iseq.path), RubyVM::InstructionSequence.from_binary_format_extra_data(binary)]
+        # raise unless extra_data(iseq.path) == RubyVM::InstructionSequence.from_binary_format_extra_data(binary)
+        iseq
       elsif COMPILE_IF_NOT_COMPILED
         compile_and_save_iseq(fname, iseq_key)
       else
Index: compile.c
===================================================================
--- compile.c	(revision 52968)
+++ compile.c	(revision 52969)
@@ -8116,7 +8116,7 @@ iseq_ibf_dump(const rb_iseq_t *iseq, VAL https://github.com/ruby/ruby/blob/trunk/compile.c#L8116
     if (RTEST(opt)) {
 	VALUE opt_str = opt;
 	const char *ptr = StringValuePtr(opt_str);
-	header.extra_size = RSTRING_LENINT(opt_str) + 1;
+	header.extra_size = RSTRING_LENINT(opt_str);
 	ibf_dump_write(dump, ptr, header.extra_size);
     }
     else {

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

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