summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
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 90da225..cd91a1a 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;