diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-19 03:25:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-19 03:25:29 +0000 |
commit | 671b498070c0fa33fa6afaf4f4672441ae61661a (patch) | |
tree | 07e887952acaa6df812940779b9a1ad907fc727f /vm_method.c | |
parent | 12cbb588193ac5148b6421fc8953c817acb0ae9f (diff) |
Commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vm_method.c b/vm_method.c index 41c53a5b47..a76277c81d 100644 --- a/vm_method.c +++ b/vm_method.c @@ -211,8 +211,10 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type, rb_class2name(rb_ivar_get(klass, attached))); mid = ID_ALLOCATOR; } + if (OBJ_FROZEN(klass)) { + rb_error_frozen("class/module"); + } - rb_check_frozen(klass); mtbl = RCLASS_M_TBL(klass); /* check re-definition */ @@ -461,7 +463,8 @@ remove_method(VALUE klass, ID mid) if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(klass)) { rb_raise(rb_eSecurityError, "Insecure: can't remove method"); } - rb_check_frozen(klass); + if (OBJ_FROZEN(klass)) + rb_error_frozen("class/module"); if (mid == object_id || mid == id__send__ || mid == idInitialize) { rb_warn("removing `%s' may cause serious problems", rb_id2name(mid)); } |