diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | encoding.c | 1 | ||||
-rw-r--r-- | vm.c | 2 |
3 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,11 @@ +Thu Dec 10 09:20:58 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * 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 <naruse@ruby-lang.org> * regcomp.c (optimize_node_left): include equal on the condition of for-loop. diff --git a/encoding.c b/encoding.c index 22a03d0ae..6b7c5a5c2 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); @@ -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); |