From da8cc8d0f4205b74f946fb22ee0adc73a577a3a7 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 21 Dec 2009 10:12:21 +0000 Subject: * 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. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- encoding.c | 1 + 1 file changed, 1 insertion(+) (limited to 'encoding.c') 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); -- cgit