diff --git a/ChangeLog b/ChangeLog index 968e24e961..274e245ebb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Dec 10 09:20:58 2009 NARUSE, Yui + + * encoding.c (Init_Encoding): undef Encoding.new because + a class which is rb_undef_alloc-func-ed can't call new method. + [ruby-dev:39862] + + * vm.c (Init_VM): undef RubyVM.new and RubyVM::Env.new. + Mon Dec 21 17:51:44 2009 NARUSE, Yui * regcomp.c (optimize_node_left): include equal on the condition of for-loop. diff --git a/encoding.c b/encoding.c index 22a03d0ae4..6b7c5a5c20 100644 --- a/encoding.c +++ b/encoding.c @@ -1505,6 +1505,7 @@ Init_Encoding(void) rb_cEncoding = rb_define_class("Encoding", rb_cObject); rb_undef_alloc_func(rb_cEncoding); + rb_undef_method(CLASS_OF(rb_cEncoding), "new"); rb_define_method(rb_cEncoding, "to_s", enc_name, 0); rb_define_method(rb_cEncoding, "inspect", enc_inspect, 0); rb_define_method(rb_cEncoding, "name", enc_name, 0); diff --git a/vm.c b/vm.c index fa028fd187..e522c9f300 100644 --- a/vm.c +++ b/vm.c @@ -1944,6 +1944,7 @@ Init_VM(void) /* ::VM */ rb_cRubyVM = rb_define_class("RubyVM", rb_cObject); rb_undef_alloc_func(rb_cRubyVM); + rb_undef_method(CLASS_OF(rb_cRubyVM), "new"); /* ::VM::FrozenCore */ fcore = rb_class_new(rb_cBasicObject); @@ -1962,6 +1963,7 @@ Init_VM(void) /* ::VM::Env */ rb_cEnv = rb_define_class_under(rb_cRubyVM, "Env", rb_cObject); rb_undef_alloc_func(rb_cEnv); + rb_undef_method(CLASS_OF(rb_cEnv), "new"); /* ::Thread */ rb_cThread = rb_define_class("Thread", rb_cObject);