[64858] trunk/dports/lang/ruby
kimuraw at macports.org
kimuraw at macports.org
Tue Mar 16 07:50:03 PDT 2010
Revision: 64858
http://trac.macports.org/changeset/64858
Author: kimuraw at macports.org
Date: 2010-03-16 07:50:02 -0700 (Tue, 16 Mar 2010)
Log Message:
-----------
lang/ruby: fix #23650, add a backport patch
raises `super called outside of method (NoMethodError)'
when "super" called at a block of a derived class
(backport from 1.8)
http://redmine.ruby-lang.org/issues/show/2537
http://redmine.ruby-lang.org/issues/show/2419
Modified Paths:
--------------
trunk/dports/lang/ruby/Portfile
Added Paths:
-----------
trunk/dports/lang/ruby/files/patch-bug23650.diff
Modified: trunk/dports/lang/ruby/Portfile
===================================================================
--- trunk/dports/lang/ruby/Portfile 2010-03-16 14:47:13 UTC (rev 64857)
+++ trunk/dports/lang/ruby/Portfile 2010-03-16 14:50:02 UTC (rev 64858)
@@ -4,7 +4,7 @@
name ruby
version 1.8.7-p249
-revision 0
+revision 1
categories lang ruby
maintainers kimuraw
@@ -42,11 +42,17 @@
# ruby bug#2648 (backport from 1.8): p249 with pthread sometimes SEGV crash
# http://redmine.ruby-lang.org/issues/show/2648
# http://redmine.ruby-lang.org/issues/show/2603
+# #23650: raises `super called outside of method (NoMethodError)'
+# when "super" called at a block of a derived class
+# (backport from 1.8)
+# http://redmine.ruby-lang.org/issues/show/2537
+# http://redmine.ruby-lang.org/issues/show/2419
patchfiles patch-vendordir.diff \
patch-bug3604.diff \
patch-bug19050.diff \
patch-bug15528.diff \
- patch-ruby_bug2648.diff
+ patch-ruby_bug2648.diff \
+ patch-bug23650.diff
# ignore getcontext() and setcontext()
# on 10.5, these functions have some problems (SEGV on ppc, slower than 1.8.6)
Added: trunk/dports/lang/ruby/files/patch-bug23650.diff
===================================================================
--- trunk/dports/lang/ruby/files/patch-bug23650.diff (rev 0)
+++ trunk/dports/lang/ruby/files/patch-bug23650.diff 2010-03-16 14:50:02 UTC (rev 64858)
@@ -0,0 +1,68 @@
+diff -ur ../ruby-1.8.7-p249.mp-patched/eval.c ./eval.c
+--- ../ruby-1.8.7-p249.mp-patched/eval.c 2010-03-15 21:50:40.000000000 +0900
++++ ./eval.c 2010-03-15 23:50:48.000000000 +0900
+@@ -8887,8 +8887,7 @@
+ _block = *data;
+ _block.block_obj = bvar;
+ if (self != Qundef) _block.frame.self = self;
+- _block.frame.last_class = klass;
+- if (!klass) _block.frame.last_func = 0;
++ if (klass) _block.frame.last_class = klass;
+ _block.frame.argc = RARRAY(tmp)->len;
+ _block.frame.flags = ruby_frame->flags;
+ if (_block.frame.argc && DMETHOD_P()) {
+@@ -9986,7 +9985,7 @@
+ VALUE mod;
+ {
+ ID id;
+- VALUE body;
++ VALUE body, orig;
+ NODE *node;
+ int noex;
+
+@@ -10005,6 +10004,7 @@
+ else {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
+ }
++ orig = body;
+ if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
+ node = NEW_DMETHOD(method_unbind(body));
+ }
+@@ -10033,7 +10033,7 @@
+ }
+ }
+ rb_add_method(mod, id, node, noex);
+- return body;
++ return orig;
+ }
+
+ /*
+diff -ur ../ruby-1.8.7-p249.mp-patched/test/ruby/test_super.rb ./test/ruby/test_super.rb
+--- ../ruby-1.8.7-p249.mp-patched/test/ruby/test_super.rb 2009-12-14 12:39:41.000000000 +0900
++++ ./test/ruby/test_super.rb 2010-03-15 23:22:03.000000000 +0900
+@@ -149,4 +149,25 @@
+ c = C.new
+ assert_equal([c, "#{C.to_s}::m"], c.m, bug2419)
+ end
++
++ module Bug2537
++ class Parent
++ def run(a)
++ a
++ end
++ end
++
++ class Child < Parent
++ def run(*a)
++ proc {super(*a)}.call
++ end
++ end
++ end
++
++ def test_super_in_block_call
++ bug2537 = '[ruby-dev:39931]'
++ assert_nothing_raised(bug2537) do
++ assert_equal(bug2537, Bug2537::Child.new.run(bug2537), bug2537)
++ end
++ end
+ end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100316/f2aa4d8f/attachment-0001.html>
More information about the macports-changes
mailing list