diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-07 08:21:01 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-07 08:21:01 +0000 |
| commit | 6d34bf2b506d5c81f529a828857b9322608d28c6 (patch) | |
| tree | b893e83c87cf62a34807a0d67d21d063093235a1 /variable.c | |
| parent | ebdd83920b6b97103c93325dbdae13aa32018f78 (diff) | |
| download | ruby-6d34bf2b506d5c81f529a828857b9322608d28c6.tar.gz ruby-6d34bf2b506d5c81f529a828857b9322608d28c6.tar.xz ruby-6d34bf2b506d5c81f529a828857b9322608d28c6.zip | |
* iseq.c (prepare_iseq_build): freeze filename and name string.
* variable.c: freeze class name string.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
| -rw-r--r-- | variable.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/variable.c b/variable.c index be94d4314..af29934ae 100644 --- a/variable.c +++ b/variable.c @@ -53,8 +53,8 @@ fc_path(struct fc_result *fc, ID name) tmp = rb_str_dup(tmp); rb_str_cat2(tmp, "::"); rb_str_append(tmp, path); - - return tmp; + path = tmp; + break; } tmp = rb_str_new2(rb_id2name(fc->name)); rb_str_cat2(tmp, "::"); @@ -62,6 +62,7 @@ fc_path(struct fc_result *fc, ID name) path = tmp; fc = fc->prev; } + OBJ_FREEZE(path); return path; } @@ -148,6 +149,7 @@ classname(VALUE klass) return find_class_path(klass); } path = rb_str_new2(rb_id2name(SYM2ID(path))); + OBJ_FREEZE(path); st_insert(ROBJECT(klass)->iv_tbl, classpath, path); st_delete(RCLASS(klass)->iv_tbl, (st_data_t*)&classid, 0); } @@ -197,6 +199,7 @@ rb_class_path(VALUE klass) } } path = rb_sprintf("#<%s:%p>", s, (void*)klass); + OBJ_FREEZE(path); rb_ivar_set(klass, tmp_classpath, path); return path; @@ -216,6 +219,7 @@ rb_set_class_path(VALUE klass, VALUE under, const char *name) rb_str_cat2(str, "::"); rb_str_cat2(str, name); } + OBJ_FREEZE(str); rb_ivar_set(klass, classpath, str); } |
