diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-19 02:00:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-19 02:00:27 +0000 |
commit | 33fc55acef6a2d7b79cf5ac084bbb94cb3b14b31 (patch) | |
tree | 1e6ce644f700a162f63bfcbf278fae6c5ffad0b6 | |
parent | 3d57dfa01b8603da4d63a85014fa4cd0b640048e (diff) |
* vm_method.c (me_opts): fixed optimized method aliasing.
[ruby-dev:38824]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_alias.rb | 8 | ||||
-rw-r--r-- | vm_method.c | 2 |
3 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sun Jul 19 11:00:14 2009 Nobuyoshi Nakada <[email protected]> + + * vm_method.c (me_opts): fixed optimized method aliasing. + [ruby-dev:38824] + Sun Jul 19 10:54:56 2009 Tanaka Akira <[email protected]> * ext/socket/lib/socket.rb (Socket.accept_loop): rescue diff --git a/test/ruby/test_alias.rb b/test/ruby/test_alias.rb index f66c4a6340..7f8a32c529 100644 --- a/test/ruby/test_alias.rb +++ b/test/ruby/test_alias.rb @@ -69,4 +69,12 @@ class TestAlias < Test::Unit::TestCase } } 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 diff --git a/vm_method.c b/vm_method.c index 4b747e9d52..9ebeeb4a4b 100644 --- a/vm_method.c +++ b/vm_method.c @@ -758,6 +758,8 @@ me_opts(const rb_method_entry_t *me) 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; |