diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-16 13:28:59 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-16 13:28:59 +0000 |
| commit | b348d297fe848fdaf4dc74f9e4073e6ab82d3244 (patch) | |
| tree | 830c971a75f5b935ca841a51011db87549585586 /class.c | |
| parent | ca0a80817033fd6e20b2f613f08ba7d0b16b1254 (diff) | |
| download | ruby-b348d297fe848fdaf4dc74f9e4073e6ab82d3244.tar.gz ruby-b348d297fe848fdaf4dc74f9e4073e6ab82d3244.tar.xz ruby-b348d297fe848fdaf4dc74f9e4073e6ab82d3244.zip | |
* class.c (rb_class_init_copy): singleton class is disallowed to copy,
from its definition. fixed: [ruby-talk:142749]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
| -rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); } |
