summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-25 08:23:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-25 08:23:34 +0000
commit3b359789b92085ea0d1a2231b3d8ef279be9b63d (patch)
tree69c44cffc0299d0fcf8be71968e384a882fba757 /class.c
parent8640bc4bc6de045cca24be5de629ce2471eb4be4 (diff)
* class.c (rb_include_module): detect cyclic module inclusion.
* eval.c (rb_thread_schedule): should check time only if BOTH WAIT_SELECT and WAIT_TIME. * string.c (rb_str_split_m): no need to consider KANJI characters, if the length of separator is 1 (byte). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class.c b/class.c
index d0263bfd96..f906390246 100644
--- a/class.c
+++ b/class.c
@@ -324,6 +324,8 @@ rb_include_module(klass, module)
}
while (module) {
+ if (RCLASS(klass)->m_tbl == RCLASS(module)->m_tbl)
+ rb_raise(rb_eArgError, "cyclic include detected");
/* ignore if the module included already in superclasses */
for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS &&