summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-08 16:05:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-08 16:05:50 +0000
commite8bdef657a5502786c1eb9fe100b29c67a9a21c2 (patch)
tree3bc58cb32cc8d7acfd8a608ac346b2e16fb6763c /class.c
parent3fd0000c0cf8fedad3b8130b11c2f93a6426d6b0 (diff)
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
Diffstat (limited to 'class.c')
-rw-r--r--class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/class.c b/class.c
index 29521c4..672a3a2 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;