зеркало из https://github.com/github/ruby.git
* 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:
Родитель
187a32495b
Коммит
fb2941a4ec
|
@ -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.
|
||||
|
|
2
class.c
2
class.c
|
@ -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)) {
|
||||
|
|
2
object.c
2
object.c
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче