summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-12 15:08:52 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-12 15:08:52 +0000
commit3703ebbe84984bed338bcc6e57d276a7f33f546b (patch)
tree0a4e080d669ca8b284a50f8e7af0c5c7cf5f0be0
parent7fe3c2665ef9ba43b4368068be6c19af0b9be43e (diff)
* vm_insnhelper.c (vm_call_method_missing): method_missing should
not be refined. [ruby-core:72080] [Bug #11809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_refinement.rb25
-rw-r--r--vm_insnhelper.c4
3 files changed, 34 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 70a0ac3..58b9901 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Dec 13 00:05:42 2015 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method_missing): method_missing should
+ not be refined.
+ [ruby-core:72080] [Bug #11809]
+
Sat Dec 12 23:00:17 2015 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: Merge nkf 2.1.4.
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 80407c0..52b7ac7 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1594,6 +1594,31 @@ class TestRefinement < Test::Unit::TestCase
assert_equal([:R2_baz, [:R1_foo, :orig_foo]], MixedUsing2.f2)
end
+ module MethodMissing
+ class Foo
+ end
+
+ module Bar
+ refine Foo do
+ def method_missing(mid, *args)
+ "method_missing refined"
+ end
+ end
+ end
+
+ using Bar
+
+ def self.call_undefined_method
+ Foo.new.foo
+ end
+ end
+
+ def test_method_missing
+ assert_raise(NoMethodError) do
+ MethodMissing.call_undefined_method
+ end
+ end
+
private
def eval_using(mod, s)
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index cfa76ab..2acf773 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1953,7 +1953,9 @@ vm_call_method_missing(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_c
ci = &ci_entry;
cc_entry = *orig_cc;
- cc_entry.me = rb_callable_method_entry(CLASS_OF(calling->recv), idMethodMissing);
+ cc_entry.me =
+ rb_callable_method_entry_without_refinements(CLASS_OF(calling->recv),
+ idMethodMissing);
cc = &cc_entry;
calling->argc = argc;