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 | 15d206a15a9f4d8cd84987ab0059d3a9407140d0 (patch) | |
tree | 276607743bebf0a8c8a94394456c0433b3031e8d /class.c | |
parent | 58cbe8ff0b3a05e4e56d2199e33b8fc01f0d7108 (diff) | |
download | ruby-15d206a15a9f4d8cd84987ab0059d3a9407140d0.tar.gz ruby-15d206a15a9f4d8cd84987ab0059d3a9407140d0.tar.xz ruby-15d206a15a9f4d8cd84987ab0059d3a9407140d0.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/trunk@8469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -105,6 +105,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); } |