зеркало из https://github.com/github/ruby.git
Always freeze strings that are in the instructions
Any objects that the instructions reference should be frozen. Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
This commit is contained in:
Родитель
a0a100db49
Коммит
774eef692c
|
@ -757,7 +757,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_
|
||||||
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
|
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ADD_INSN1(ret, &dummy_line_node, putstring, current_string);
|
ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string));
|
||||||
}
|
}
|
||||||
current_string = Qnil;
|
current_string = Qnil;
|
||||||
number_of_items_pushed++;
|
number_of_items_pushed++;
|
||||||
|
@ -776,7 +776,7 @@ pm_interpolated_node_compile(pm_node_list_t *parts, rb_iseq_t *iseq, NODE dummy_
|
||||||
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
|
ADD_INSN1(ret, &dummy_line_node, putobject, rb_str_freeze(current_string));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ADD_INSN1(ret, &dummy_line_node, putstring, current_string);
|
ADD_INSN1(ret, &dummy_line_node, putstring, rb_str_freeze(current_string));
|
||||||
}
|
}
|
||||||
current_string = Qnil;
|
current_string = Qnil;
|
||||||
number_of_items_pushed++;
|
number_of_items_pushed++;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче