diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-25 08:22:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-25 08:22:11 +0000 |
commit | f547c1150cf0cb9fe2477e6aeb4ff7b724fc44c7 (patch) | |
tree | bdf1c6377a12f1405ac48b2819ac59fbeb4c12a5 /class.c | |
parent | eb9708f38671aa6446a89acc755f3341f5cb59b6 (diff) |
* class.c (rb_include_module): detect cyclic module inclusion.
* eval.c (rb_thread_cleanup): need not to free thread stacks at
process termination.
* array.c (rb_ary_fetch): use the block to get the default value
if the block is given.
* eval.c (rb_thread_schedule): should check time only if BOTH
WAIT_SELECT and WAIT_TIME.
* eval.c (umethod_bind): should update rklass field.
* hash.c (rb_hash_update): if a block is given, yields [key,
value1, value2] to the block to resolve conflict.
* 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/trunk@2015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -349,11 +349,13 @@ rb_include_module(klass, module) OBJ_INFECT(klass, module); c = klass; 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 && - RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) { - goto skip; + if (BUILTIN_TYPE(p) == T_ICLASS) { + if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) + goto skip; } } RCLASS(c)->super = include_class_new(module, RCLASS(c)->super); |