diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | class.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,8 +1,11 @@ -Mon May 16 22:21:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> +Mon May 16 22:28:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/win32.h, {bcc32,win32,wince}/Makefile.sub: moved rb_[ugp]id_t to get rid of redefinition warnings on mingw. + * class.c (rb_class_init_copy): singleton class is disallowed to copy, + from its definition. fixed: [ruby-talk:142749] + Mon May 16 08:52:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> * win32/win32.{h,c}: define rb_{p,g,u}id_t. @@ -92,6 +92,9 @@ rb_class_init_copy(clone, orig) if (RCLASS(clone)->super != 0) { rb_raise(rb_eTypeError, "already initialized class"); } + if (FL_TEST(orig, FL_SINGLETON)) { + rb_raise(rb_eTypeError, "can't copy singleton class"); + } return rb_mod_init_copy(clone, orig); } |