summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 13:03:46 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 13:03:46 (GMT)
commit4df147d6e8b6503b4a3068a3e9330e5d90ba3d87 (patch)
treed9a4e539e742e38acacbc36cdf068c31bd9b6e56 /include
parent05b374b82461af2d68dfba472cf382bcc98379d7 (diff)
class.c: freeze meta class only
* class.c (singleton_class_of): should not propagete freezing to meta meta class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index b198e65..4b57e78 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1105,6 +1105,7 @@ struct RStruct {
RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT : 0)
#define OBJ_FROZEN(x) (FL_ABLE(x) ? !!(RBASIC(x)->flags&FL_FREEZE) : 1)
+#define OBJ_FREEZE_RAW(x) (RBASIC(x)->flags |= FL_FREEZE)
#define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)
static inline void
@@ -1112,9 +1113,9 @@ rb_obj_freeze_inline(VALUE x)
{
if (FL_ABLE(x)) {
VALUE klass = RBASIC_CLASS(x);
- RBASIC(x)->flags |= FL_FREEZE;
+ OBJ_FREEZE_RAW(x);
if (FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
- RBASIC(klass)->flags |= FL_FREEZE;
+ OBJ_FREEZE_RAW(klass);
}
}
}