diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-30 03:31:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-30 03:31:43 +0000 |
commit | 787cdae5df0c7f5b09c9581702334f8f4029b3c1 (patch) | |
tree | cd55b85954663b09fe56aead8c430020f6c0548d /vm.c | |
parent | e9fa3108f19d2c7a33664744444f8cd7af0043a9 (diff) | |
download | ruby-787cdae5df0c7f5b09c9581702334f8f4029b3c1.tar.gz |
proc.c: frozen core methods
* proc.c (mproc, mlambda): use frozen core methods instead of plain
global methods, so that methods cannot be overridden.
[ruby-core:54687] [Bug #8345]
* vm.c (Init_VM): define proc and lambda on the frozen core object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2258,6 +2258,8 @@ Init_VM(void) rb_define_method_id(klass, id_core_hash_merge_ary, m_core_hash_merge_ary, 2); rb_define_method_id(klass, id_core_hash_merge_ptr, m_core_hash_merge_ptr, -1); rb_define_method_id(klass, id_core_hash_merge_kwd, m_core_hash_merge_kwd, 2); + rb_define_method(klass, "proc", rb_block_proc, 0); + rb_define_method(klass, "lambda", rb_block_lambda, 0); rb_obj_freeze(fcore); rb_gc_register_mark_object(fcore); rb_mRubyVMFrozenCore = fcore; |