ruby-changes:44710
From: nagachika <ko1@a...>
Date: Tue, 15 Nov 2016 02:59:47 +0900 (JST)
Subject: [ruby-changes:44710] nagachika:r56783 (ruby_2_3): merge revision(s) 56520: [Backport #12876]
nagachika 2016-11-15 02:59:42 +0900 (Tue, 15 Nov 2016) New Revision: 56783 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56783 Log: merge revision(s) 56520: [Backport #12876] * vm_eval.c (vm_call0_body): follow the original class, not to loop the prepended module. [ruby-core:77784] [Bug #12876] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/test/ruby/test_super.rb branches/ruby_2_3/version.h branches/ruby_2_3/vm_eval.c Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 56782) +++ ruby_2_3/version.h (revision 56783) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.2" #define RUBY_RELEASE_DATE "2016-11-15" -#define RUBY_PATCHLEVEL 214 +#define RUBY_PATCHLEVEL 215 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_3/test/ruby/test_super.rb =================================================================== --- ruby_2_3/test/ruby/test_super.rb (revision 56782) +++ ruby_2_3/test/ruby/test_super.rb (revision 56783) @@ -530,4 +530,18 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_super.rb#L530 assert_equal "b", b.new.foo{"c"} end + + def test_public_zsuper_with_prepend + bug12876 = '[ruby-core:77784] [Bug #12876]' + m = EnvUtil.labeled_module("M") + c = EnvUtil.labeled_class("C") {prepend m; public :initialize} + o = assert_nothing_raised(Timeout::Error, bug12876) { + Timeout.timeout(3) {c.new} + } + assert_instance_of(c, o) + m.module_eval {def initialize; raise "exception in M"; end} + assert_raise_with_message(RuntimeError, "exception in M") { + c.new + } + end end Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 56782) +++ ruby_2_3/ChangeLog (revision 56783) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Tue Nov 15 02:49:30 2016 Nobuyoshi Nakada <nobu@r...> + + * vm_eval.c (vm_call0_body): follow the original class, not to + loop the prepended module. [ruby-core:77784] [Bug #12876] + Tue Nov 15 02:45:44 2016 NARUSE, Yui <naruse@r...> * lib/net/http.rb (transport_request): other than HTTPContinue Index: ruby_2_3/vm_eval.c =================================================================== --- ruby_2_3/vm_eval.c (revision 56782) +++ ruby_2_3/vm_eval.c (revision 56783) @@ -207,7 +207,7 @@ vm_call0_body(rb_thread_t* th, struct rb https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_eval.c#L207 goto again; } - super_class = RCLASS_SUPER(cc->me->defined_class); + super_class = RCLASS_SUPER(RCLASS_ORIGIN(cc->me->defined_class)); if (!super_class || !(cc->me = rb_callable_method_entry(super_class, ci->mid))) { enum method_missing_reason ex = (type == VM_METHOD_TYPE_ZSUPER) ? MISSING_SUPER : 0; Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56520 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/