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

ruby-changes:20965

From: ktsj <ko1@a...>
Date: Sat, 20 Aug 2011 13:31:30 +0900 (JST)
Subject: [ruby-changes:20965] ktsj:r33014 (ruby_1_9_3): * backport r33013 from trunk.

ktsj	2011-08-20 13:31:20 +0900 (Sat, 20 Aug 2011)

  New Revision: 33014

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

  Log:
    * backport r33013 from trunk.
    
    * iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
    
    * test/ruby/test_method.rb (test_body): add a test for the above change.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/iseq.c
    branches/ruby_1_9_3/test/ruby/test_method.rb

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 33013)
+++ ruby_1_9_3/ChangeLog	(revision 33014)
@@ -1,3 +1,11 @@
+Sat Aug 20 13:28:32 2011  Kazuki Tsujimoto  <kazuki@c...>
+
+	* backport r33013 from trunk.
+
+	* iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
+
+	* test/ruby/test_method.rb (test_body): add a test for the above change.
+
 Sat Aug 20 10:43:24 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/stringio/stringio.c (strio_read): return new string if nil
Index: ruby_1_9_3/iseq.c
===================================================================
--- ruby_1_9_3/iseq.c	(revision 33013)
+++ ruby_1_9_3/iseq.c	(revision 33014)
@@ -1030,9 +1030,9 @@
 	rb_proc_t *proc;
 	VALUE iseqval;
 	GetProcPtr(body, proc);
-	iseqval = proc->block.iseq->self;
-	if (RUBY_VM_NORMAL_ISEQ_P(iseqval)) {
-	    ret = rb_iseq_disasm(iseqval);
+	iseq = proc->block.iseq;
+	if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+	    ret = rb_iseq_disasm(iseq->self);
 	}
     }
     else if ((iseq = rb_method_get_iseq(body)) != 0) {
Index: ruby_1_9_3/test/ruby/test_method.rb
===================================================================
--- ruby_1_9_3/test/ruby/test_method.rb	(revision 33013)
+++ ruby_1_9_3/test/ruby/test_method.rb	(revision 33014)
@@ -123,6 +123,7 @@
     def o.foo; end
     assert_nothing_raised { RubyVM::InstructionSequence.disasm(o.method(:foo)) }
     assert_nothing_raised { RubyVM::InstructionSequence.disasm("x".method(:upcase)) }
+    assert_nothing_raised { RubyVM::InstructionSequence.disasm(method(:to_s).to_proc) }
   end
 
   def test_new

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

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