Skip to content

Commit 602edc0

Browse files
committed
merge revision(s) 49867: [Backport ruby#10847] [Backport ruby#10970]
* vm_eval.c (vm_call_super): search next super class from the original class, to get rid of infinite recursion with prepending. a patch by Seiei Higa <hanachin AT gmail.com> at [ruby-core:68434]. [ruby-core:68093] [Bug ruby#10847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4852673 commit 602edc0

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Mon Apr 13 16:48:14 2015 Nobuyoshi Nakada <[email protected]>
2+
3+
* vm_eval.c (vm_call_super): search next super class from the
4+
original class, to get rid of infinite recursion with
5+
prepending. a patch by Seiei Higa <hanachin AT gmail.com> at
6+
[ruby-core:68434]. [ruby-core:68093] [Bug #10847]
7+
18
Mon Apr 13 16:39:57 2015 Nobuyoshi Nakada <[email protected]>
29

310
* parse.y (arg): fix segfault by null caused by syntax error.

test/ruby/test_module.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,17 @@ def hello
17081708
assert_equal('hello!', foo.new.hello, bug9236)
17091709
end
17101710

1711+
def test_prepend_call_super
1712+
assert_separately([], <<-'end;') #do
1713+
bug10847 = '[ruby-core:68093] [Bug #10847]'
1714+
module M; end
1715+
Float.prepend M
1716+
assert_nothing_raised(SystemStackError, bug10847) do
1717+
0.3.numerator
1718+
end
1719+
end;
1720+
end
1721+
17111722
def test_class_variables
17121723
m = Module.new
17131724
m.class_variable_set(:@@foo, 1)

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.5"
22
#define RUBY_RELEASE_DATE "2015-04-13"
3-
#define RUBY_PATCHLEVEL 330
3+
#define RUBY_PATCHLEVEL 331
44

55
#define RUBY_RELEASE_YEAR 2015
66
#define RUBY_RELEASE_MONTH 4

vm_eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ vm_call_super(rb_thread_t *th, int argc, const VALUE *argv)
260260
rb_bug("vm_call_super: should not be reached");
261261
}
262262

263-
klass = RCLASS_SUPER(cfp->klass);
263+
klass = RCLASS_ORIGIN(cfp->klass);
264+
klass = RCLASS_SUPER(klass);
264265
id = cfp->me->def->original_id;
265266
me = rb_method_entry(klass, id, &klass);
266267
if (!me) {

0 commit comments

Comments
 (0)