mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_insnhelper.c: fix unusable super class
* vm_insnhelper.c (vm_call_method): unusable super class should cause method missing when BasicObject is refined but not been using. [ruby-core:64166] [Bug #10106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c3e1258ccd
commit
a6d34e7501
3 changed files with 25 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun Aug 3 10:43:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_call_method): unusable super class should cause
|
||||||
|
method missing when BasicObject is refined but not been using.
|
||||||
|
[ruby-core:64166] [Bug #10106]
|
||||||
|
|
||||||
Sat Aug 2 23:47:45 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
Sat Aug 2 23:47:45 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
* ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file
|
* ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file
|
||||||
|
|
|
@ -1151,6 +1151,21 @@ class TestRefinement < Test::Unit::TestCase
|
||||||
INPUT
|
INPUT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_refine_basic_object
|
||||||
|
assert_separately([], <<-"end;")
|
||||||
|
bug10106 = '[ruby-core:64166] [Bug #10106]'
|
||||||
|
module RefinementBug
|
||||||
|
refine BasicObject do
|
||||||
|
def foo
|
||||||
|
1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_raise(NoMethodError, bug10106) {Object.new.foo}
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def eval_using(mod, s)
|
def eval_using(mod, s)
|
||||||
|
|
|
@ -1823,6 +1823,10 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
|
||||||
klass = RCLASS_ORIGIN(klass);
|
klass = RCLASS_ORIGIN(klass);
|
||||||
zsuper_method_dispatch:
|
zsuper_method_dispatch:
|
||||||
klass = RCLASS_SUPER(klass);
|
klass = RCLASS_SUPER(klass);
|
||||||
|
if (!klass) {
|
||||||
|
ci->me = 0;
|
||||||
|
goto start_method_dispatch;
|
||||||
|
}
|
||||||
ci_temp = *ci;
|
ci_temp = *ci;
|
||||||
ci = &ci_temp;
|
ci = &ci_temp;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue