diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-12 08:13:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-12 08:13:28 +0000 |
commit | b41909f603dce3c8f48d49514c50d6813a1ca491 (patch) | |
tree | 4d3b74fb148cec78c9940017a013179079151c98 /eval.c | |
parent | 94ee7c47cd5f818eb72cc9830bfcf23a642bff3f (diff) |
vm_method.c: should not modify frozen objects
* vm_method.c (rb_method_entry_make, remove_method): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -409,6 +409,10 @@ rb_frozen_class_p(VALUE klass) noclass: Check_Type(klass, T_CLASS); } + if (FL_TEST(klass, FL_SINGLETON)) { + VALUE obj = rb_ivar_get(klass, id__attached__); + if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass); + } if (OBJ_FROZEN(klass)) { const char *desc; |