summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--test/ruby/test_exception.rb7
-rw-r--r--vm_eval.c1
3 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a431c7add..53ee9e3c17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Jul 29 15:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (send_internal): set method_missing_reason before
+ invoking overriding method_missing method so that the default
+ method_missing can achieve it properly.
+ [ruby-core:68515] [Bug #10969]
+
Wed Jul 29 14:54:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_sym_hash): return same value as rb_any_hash() of
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 2817c63bed..b4567d9187 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -704,4 +704,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
raise E
end;
end
+
+ def test_method_missing_reason_clear
+ bug10969 = '[ruby-core:68515] [Bug #10969]'
+ a = Class.new {def method_missing(*) super end}.new
+ assert_raise(NameError) {a.instance_eval("foo")}
+ assert_raise(NoMethodError, bug10969) {a.public_send("bar", true)}
+ end
end
diff --git a/vm_eval.c b/vm_eval.c
index 4b59d61c73..25d9f3251c 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -913,6 +913,7 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
}
}
id = idMethodMissing;
+ th->method_missing_reason = MISSING_NOENTRY;
}
else {
argv++; argc--;