summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-12 08:13:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-12 08:13:28 +0000
commitb41909f603dce3c8f48d49514c50d6813a1ca491 (patch)
tree4d3b74fb148cec78c9940017a013179079151c98 /eval.c
parent94ee7c47cd5f818eb72cc9830bfcf23a642bff3f (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 90da22503e..cd91a1a735 100644
--- a/eval.c
+++ b/eval.c
@@ -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;