diff --git a/ChangeLog b/ChangeLog index 24363fe6d5..728bc7a250 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Sep 29 10:12:20 2007 Tanaka Akira + + * 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 * object.c (rb_class_real): use BUILTIN_TYPE instead of TYPE. diff --git a/object.c b/object.c index a6ded56724..031d2afdc8 100644 --- a/object.c +++ b/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); } diff --git a/variable.c b/variable.c index d5c3bfe100..16859c2cab 100644 --- a/variable.c +++ b/variable.c @@ -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;