зеркало из https://github.com/github/ruby.git
* iseq.c (prepare_iseq_build): freeze filename and name string.
* variable.c: freeze class name string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8620de6b04
Коммит
d7d85f9ecd
|
@ -1,3 +1,9 @@
|
|||
Thu Jun 7 17:20:57 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* iseq.c (prepare_iseq_build): freeze filename and name string.
|
||||
|
||||
* variable.c: freeze class name string.
|
||||
|
||||
Thu Jun 7 12:48:33 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* cont.c (cont_restore_1): fix to check root fiber [ruby-dev:30911].
|
||||
|
|
5
iseq.c
5
iseq.c
|
@ -109,9 +109,12 @@ prepare_iseq_build(rb_iseq_t *iseq,
|
|||
{
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
|
||||
OBJ_FREEZE(name);
|
||||
OBJ_FREEZE(filename);
|
||||
|
||||
iseq->name = name;
|
||||
iseq->defined_method_id = 0;
|
||||
iseq->filename = filename;
|
||||
iseq->defined_method_id = 0;
|
||||
iseq->iseq_mark_ary = rb_ary_new();
|
||||
RBASIC(iseq->iseq_mark_ary)->klass = 0;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче