зеркало из https://github.com/github/ruby.git
* string.c (setup_fake_str): fake strings should not set class by
RBASIC_SET_CLASS() because it insert write barriers to fake (non-RVALUE) structure. It can cause unexpected behaviour. Ruby 2.1 also have a same problem (setup_fake_str() in parse.y). * symbol.c (setup_fake_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b5e89e44f1
Коммит
6f7366c206
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
Fri Aug 15 19:34:33 2014 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* string.c (setup_fake_str): fake strings should not set class by
|
||||
RBASIC_SET_CLASS() because it insert write barriers to fake
|
||||
(non-RVALUE) structure.
|
||||
|
||||
It can cause unexpected behaviour.
|
||||
|
||||
Ruby 2.1 also have a same problem (setup_fake_str() in parse.y).
|
||||
|
||||
* symbol.c (setup_fake_str): ditto.
|
||||
|
||||
Fri Aug 15 19:27:25 2014 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* array.c (rb_ary_tmp_new): added.
|
||||
|
|
2
string.c
2
string.c
|
@ -240,7 +240,7 @@ setup_fake_str(struct RString *fake_str, const char *name, long len, int encidx)
|
|||
|
||||
ENCODING_SET_INLINED((VALUE)fake_str, encidx);
|
||||
|
||||
RBASIC_SET_CLASS((VALUE)fake_str, rb_cString);
|
||||
RBASIC_SET_CLASS_RAW((VALUE)fake_str, rb_cString);
|
||||
fake_str->as.heap.len = len;
|
||||
fake_str->as.heap.ptr = (char *)name;
|
||||
fake_str->as.heap.aux.capa = len;
|
||||
|
|
2
symbol.c
2
symbol.c
|
@ -414,7 +414,7 @@ static VALUE
|
|||
setup_fake_str(struct RString *fake_str, const char *name, long len)
|
||||
{
|
||||
fake_str->basic.flags = T_STRING|RSTRING_NOEMBED;
|
||||
RBASIC_SET_CLASS((VALUE)fake_str, rb_cString);
|
||||
RBASIC_SET_CLASS_RAW((VALUE)fake_str, rb_cString);
|
||||
fake_str->as.heap.len = len;
|
||||
fake_str->as.heap.ptr = (char *)name;
|
||||
fake_str->as.heap.aux.capa = len;
|
||||
|
|
Загрузка…
Ссылка в новой задаче