diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-08 13:47:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-08 13:47:11 +0000 |
commit | 3fd0000c0cf8fedad3b8130b11c2f93a6426d6b0 (patch) | |
tree | 81b3b1948e3cc2d48b677f987c855a205613ca75 /class.c | |
parent | 6359460610c0a43d515f3da71b4e8901759d855f (diff) | |
download | ruby-3fd0000c0cf8fedad3b8130b11c2f93a6426d6b0.tar.gz |
class.c: exclude original module
* class.c (rb_mod_included_modules): should not include the original
module itself. [ruby-core:53158] [Bug #8025]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -851,9 +851,10 @@ rb_mod_included_modules(VALUE mod) { VALUE ary = rb_ary_new(); VALUE p; + VALUE origin = RCLASS_ORIGIN(mod); for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) { - if (BUILTIN_TYPE(p) == T_ICLASS) { + if (p != origin && BUILTIN_TYPE(p) == T_ICLASS) { rb_ary_push(ary, RBASIC(p)->klass); } } |