1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_insnhelper.c (vm_call_method): revert r30064 and r30071,

because of [ruby-core:26761]. Bug#4106 rejected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-03 23:25:19 +00:00
parent b95ce36ed4
commit b942e7891a
3 changed files with 9 additions and 22 deletions

View file

@ -1,3 +1,8 @@
Sat Dec 4 08:25:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_insnhelper.c (vm_call_method): revert r30064 and r30071,
because of [ruby-core:26761]. Bug#4106 rejected.
Sat Dec 4 07:46:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (String#tr_cpp): substitute * with P like as

View file

@ -411,25 +411,4 @@ class TestMethod < Test::Unit::TestCase
assert_nothing_raised { v.instance_eval { mv2 } }
assert_nothing_raised { v.instance_eval { mv3 } }
end
def test_protected_singleton
bug4106 = '[ruby-core:33506]'
a = Class.new do
def meth
:called
end
def test
a = dup
a.extend(Module.new)
a.extend(Module.new)
class << a
protected :meth
end
a.meth
end
end.new
called = nil
assert_nothing_raised(NoMethodError, bug4106) {called = a.test}
assert_equal(:called, called, bug4106)
end
end

View file

@ -629,7 +629,10 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
else if (!(flag & VM_CALL_OPT_SEND_BIT) && (me->flag & NOEX_MASK) & NOEX_PROTECTED) {
VALUE defined_class = me->klass;
defined_class = rb_class_real(defined_class);
if (RB_TYPE_P(defined_class, T_ICLASS)) {
defined_class = RBASIC(defined_class)->klass;
}
if (!rb_obj_is_kind_of(cfp->self, defined_class)) {
val = vm_method_missing(th, id, recv, num, blockptr, NOEX_PROTECTED);
}