Project

General

Profile

Bug #3528 ยป culprit.txt

"git show" of the fatal commit. - jeremy_henty (Jeremy Henty), 07/03/2010 08:37 PM

 
1
commit cae4321112270231e3a4aa8c53c07df194a67dc8
2
Author: yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
3
Date:   Sat Jan 30 12:53:22 2010 +0000
4

    
5
    merges r25494 from trunk into ruby_1_9_1.
6
    adds a test case for the change
7
    --
8
    * vm.c (invoke_block_from_c): return Qnil when its iseq is
9
      SPECIAL CONST. [ruby-core:26335]
10
    
11
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
12

    
13
diff --git a/ChangeLog b/ChangeLog
14
index fc42212..c1043fa 100644
15
--- a/ChangeLog
16
+++ b/ChangeLog
17
@@ -1,3 +1,8 @@
18
+Tue Oct 27 05:56:39 2009  NARUSE, Yui  <naruse@ruby-lang.org>
19
+
20
+	* vm.c (invoke_block_from_c): return Qnil when its iseq is
21
+	  SPECIAL CONST. [ruby-core:26335]
22
+
23
 Mon Oct 26 12:06:27 2009  Nobuyoshi Nakada  <nobu@ruby-lang.org>
24
 
25
 	* io.c (io_fwrite): adjust stdio file position after direct write on
26
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb
27
index 2a2c6ae..3c91ed1 100644
28
--- a/test/ruby/test_yield.rb
29
+++ b/test/ruby/test_yield.rb
30
@@ -1,7 +1,7 @@
31
 require 'test/unit'
32
+require_relative 'envutil'
33
 
34
 class TestRubyYield < Test::Unit::TestCase
35
-
36
   def test_ary_each
37
     ary = [1]
38
     ary.each {|a, b, c, d| assert_equal [1,nil,nil,nil], [a,b,c,d] }
39
@@ -83,6 +83,26 @@ class TestRubyYield < Test::Unit::TestCase
40
     }
41
     assert_equal([1,2,[3],4,5], r, "[ruby-core:19485]")
42
   end
43
+
44
+  def test_through_a_method_defined_by_define_method
45
+    assert_normal_exit(<<-EOS, "[ruby-core:26335]")
46
+      class C
47
+        def meth
48
+          yield 1
49
+        end
50
+      end
51
+      
52
+      class D < C
53
+        define_method(:meth) do
54
+          super()
55
+        end
56
+      end
57
+      begin
58
+        D.new.meth {}
59
+      rescue LocalJumpError
60
+      end
61
+    EOS
62
+  end
63
 end
64
 
65
 require_relative 'sentence'
66
diff --git a/version.h b/version.h
67
index 76effda..f578844 100644
68
--- a/version.h
69
+++ b/version.h
70
@@ -1,5 +1,5 @@
71
 #define RUBY_VERSION "1.9.1"
72
-#define RUBY_PATCHLEVEL 411
73
+#define RUBY_PATCHLEVEL 412
74
 #define RUBY_VERSION_MAJOR 1
75
 #define RUBY_VERSION_MINOR 9
76
 #define RUBY_VERSION_TEENY 1
77
diff --git a/vm.c b/vm.c
78
index f357156..dfdcb17 100644
79
--- a/vm.c
80
+++ b/vm.c
81
@@ -493,7 +493,9 @@ invoke_block_from_c(rb_thread_t *th, const rb_block_t *block,
82
 		    VALUE self, int argc, const VALUE *argv,
83
 		    const rb_block_t *blockptr, const NODE *cref)
84
 {
85
-    if (BUILTIN_TYPE(block->iseq) != T_NODE) {
86
+    if (SPECIAL_CONST_P(block->iseq))
87
+	return Qnil;
88
+    else if (BUILTIN_TYPE(block->iseq) != T_NODE) {
89
 	const rb_iseq_t *iseq = block->iseq;
90
 	const rb_control_frame_t *cfp;
91
 	int i, opt_pc, arg_size = iseq->arg_size;