diff --git a/ChangeLog b/ChangeLog index c214f213ef..c3d1c061a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Aug 9 10:53:57 2013 Kazuki Tsujimoto + + * time.c (get_timeval, get_new_timeval): use rb_obj_class() + instead of CLASS_OF() because CLASS_OF() may return + a singleton class. + Fri Aug 9 10:42:11 2013 Kazuki Tsujimoto * vm_insnhelper.c (vm_invoke_block): returning from lambda proc diff --git a/time.c b/time.c index 20476e9343..68a6b7e95e 100644 --- a/time.c +++ b/time.c @@ -1817,7 +1817,7 @@ get_timeval(VALUE obj) struct time_object *tobj; TypedData_Get_Struct(obj, struct time_object, &time_data_type, tobj); if (!TIME_INIT_P(tobj)) { - rb_raise(rb_eTypeError, "uninitialized %"PRIsVALUE, CLASS_OF(obj)); + rb_raise(rb_eTypeError, "uninitialized %"PRIsVALUE, rb_obj_class(obj)); } return tobj; } @@ -1828,7 +1828,7 @@ get_new_timeval(VALUE obj) struct time_object *tobj; TypedData_Get_Struct(obj, struct time_object, &time_data_type, tobj); if (TIME_INIT_P(tobj)) { - rb_raise(rb_eTypeError, "already initialized %"PRIsVALUE, CLASS_OF(obj)); + rb_raise(rb_eTypeError, "already initialized %"PRIsVALUE, rb_obj_class(obj)); } return tobj; }