ruby-changes:12499
From: nobu <ko1@a...>
Date: Sun, 19 Jul 2009 11:00:43 +0900 (JST)
Subject: [ruby-changes:12499] Ruby:r24201 (trunk): * vm_method.c (me_opts): fixed optimized method aliasing.
nobu 2009-07-19 11:00:27 +0900 (Sun, 19 Jul 2009) New Revision: 24201 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24201 Log: * vm_method.c (me_opts): fixed optimized method aliasing. [ruby-dev:38824] Modified files: trunk/ChangeLog trunk/test/ruby/test_alias.rb trunk/vm_method.c Index: ChangeLog =================================================================== --- ChangeLog (revision 24200) +++ ChangeLog (revision 24201) @@ -1,3 +1,8 @@ +Sun Jul 19 11:00:14 2009 Nobuyoshi Nakada <nobu@r...> + + * vm_method.c (me_opts): fixed optimized method aliasing. + [ruby-dev:38824] + Sun Jul 19 10:54:56 2009 Tanaka Akira <akr@f...> * ext/socket/lib/socket.rb (Socket.accept_loop): rescue Index: vm_method.c =================================================================== --- vm_method.c (revision 24200) +++ vm_method.c (revision 24201) @@ -758,6 +758,8 @@ case VM_METHOD_TYPE_NOTIMPLEMENTED: case VM_METHOD_TYPE_UNDEF: return 0; + case VM_METHOD_TYPE_OPTIMIZED: + return (void *)me->body.optimize_type; default: rb_bug("rb_add_method: unsupported method type (%d)\n", me->type); return 0; Index: test/ruby/test_alias.rb =================================================================== --- test/ruby/test_alias.rb (revision 24200) +++ test/ruby/test_alias.rb (revision 24201) @@ -69,4 +69,12 @@ } } end + + def test_send_alias + x = "abc" + class << x + alias_method :try, :__send__ + end + assert_equal("ABC", x.try(:upcase), '[ruby-dev:38824]') + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/