From e8bdef657a5502786c1eb9fe100b29c67a9a21c2 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 May 2013 16:05:50 +0000 Subject: class.c: include modules only * class.c (rb_mod_included_modules): should not include non-modules. [ruby-core:53158] [Bug #8025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'class.c') diff --git a/class.c b/class.c index 29521c44b2..672a3a28fa 100644 --- a/class.c +++ b/class.c @@ -855,7 +855,9 @@ rb_mod_included_modules(VALUE mod) for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) { if (p != origin && BUILTIN_TYPE(p) == T_ICLASS) { - rb_ary_push(ary, RBASIC(p)->klass); + VALUE m = RBASIC(p)->klass; + if (RB_TYPE_P(m, T_MODULE)) + rb_ary_push(ary, m); } } return ary; -- cgit v1.2.3