diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-18 08:28:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-18 08:28:39 +0000 |
commit | 2521b33ed74822cb6e81a180bfbcfff3e1683815 (patch) | |
tree | 834de15f9d5c89449fe1bbeea9d4f905b35aad12 /variable.c | |
parent | 98da73bc963e17b25c9df961f407c91cffbfc2f4 (diff) | |
download | ruby-2521b33ed74822cb6e81a180bfbcfff3e1683815.tar.gz |
* object.c (rb_obj_freeze): preserve frozen state of immediate
values in internal hash table, a la generic_ivar.
* object.c (rb_obj_frozen_p): check immediate values too.
* variable.c (generic_ivar_set): add frozen check fro immediate
values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c index a38bd8ea3c..79de10e446 100644 --- a/variable.c +++ b/variable.c @@ -804,12 +804,12 @@ generic_ivar_set(VALUE obj, ID id, VALUE val) st_data_t data; if (rb_special_const_p(obj)) { + if (rb_obj_frozen_p(obj)) rb_error_frozen("object"); special_generic_ivar = 1; } if (!generic_iv_tbl) { generic_iv_tbl = st_init_numtable(); } - if (!st_lookup(generic_iv_tbl, obj, &data)) { FL_SET(obj, FL_EXIVAR); tbl = st_init_numtable(); |