* object.c (rb_class_initialize): Make sure BasicObject doesn't get initialized twice [ruby-core:27577]

* class.c (rb_class_init_copy): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2010-01-13 02:57:48 +00:00
Родитель 187a32495b
Коммит fb2941a4ec
3 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,10 @@
Wed Jan 13 11:57:38 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* object.c (rb_class_initialize): Make sure BasicObject doesn't get
initialized twice [ruby-core:27577]
* class.c (rb_class_init_copy): ditto
Wed Jan 13 06:54:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: check for if struct timezone is defined.

Просмотреть файл

@ -180,7 +180,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
VALUE
rb_class_init_copy(VALUE clone, VALUE orig)
{
if (RCLASS_SUPER(clone) != 0) {
if (RCLASS_SUPER(clone) != 0 || clone == rb_cBasicObject) {
rb_raise(rb_eTypeError, "already initialized class");
}
if (FL_TEST(orig, FL_SINGLETON)) {

Просмотреть файл

@ -1427,7 +1427,7 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass)
{
VALUE super;
if (RCLASS_SUPER(klass) != 0) {
if (RCLASS_SUPER(klass) != 0 || klass == rb_cBasicObject) {
rb_raise(rb_eTypeError, "already initialized class");
}
if (argc == 0) {