summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-27 21:09:19 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-27 21:09:19 +0000
commit40e0921a17698f03475d098265f55d9faedcfda5 (patch)
treed651288a08d653537eb5a78a1965851c8ebd15e2
parenta6eea9be6e27ab951c0aed1e2338ae73b151035f (diff)
merge revision(s) 51427: [Backport #10969]
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--test/ruby/test_exception.rb7
-rw-r--r--version.h2
-rw-r--r--vm_eval.c1
4 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 29340bfe73..161a4b9dd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Nov 28 05:50:58 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]
+
Sat Nov 28 05:47:27 2015 Rei Odaira <Rei.Odaira@gmail.com>
* test/ruby/test_symbol.rb (test_symbol_fstr_leak): add a warm-up
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index c68d226333..65d00e8bcd 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -698,4 +698,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/version.h b/version.h
index 5aa0493ce2..59121b0d93 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.4"
#define RUBY_RELEASE_DATE "2015-11-28"
-#define RUBY_PATCHLEVEL 203
+#define RUBY_PATCHLEVEL 204
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 11
diff --git a/vm_eval.c b/vm_eval.c
index a34405454b..d0a60ae884 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -926,6 +926,7 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
}
}
id = idMethodMissing;
+ th->method_missing_reason = 0;
}
else {
argv++; argc--;