зеркало из https://github.com/github/ruby.git
* variable.c (rb_ivar_set): fix class instance variable.
* object.c (rb_class_real): cl argument may be 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5a3e59d284
Коммит
238ac9fcb2
|
@ -1,3 +1,9 @@
|
|||
Sat Sep 29 10:12:20 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* variable.c (rb_ivar_set): fix class instance variable.
|
||||
|
||||
* object.c (rb_class_real): cl argument may be 0.
|
||||
|
||||
Sat Sep 29 09:12:02 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* object.c (rb_class_real): use BUILTIN_TYPE instead of TYPE.
|
||||
|
|
2
object.c
2
object.c
|
@ -99,6 +99,8 @@ rb_obj_equal(VALUE obj1, VALUE obj2)
|
|||
VALUE
|
||||
rb_class_real(VALUE cl)
|
||||
{
|
||||
if (cl == 0)
|
||||
return 0;
|
||||
while ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS) {
|
||||
cl = RCLASS_SUPER(cl);
|
||||
}
|
||||
|
|
|
@ -1027,6 +1027,7 @@ rb_ivar_set(VALUE obj, ID id, VALUE val)
|
|||
case T_MODULE:
|
||||
if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable();
|
||||
st_insert(RCLASS_IV_TBL(obj), id, val);
|
||||
break;
|
||||
default:
|
||||
generic_ivar_set(obj, id, val);
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче