зеркало из https://github.com/github/ruby.git
parse.y: keep nodes linking
* parse.y (remove_duplicate_keys): should keep nodes linking not to be collected. [Bug #10315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d5526c660d
Коммит
4a883ff9a8
6
parse.y
6
parse.y
|
@ -9601,6 +9601,9 @@ append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
|
||||||
{
|
{
|
||||||
NODE *node = (NODE *)v;
|
NODE *node = (NODE *)v;
|
||||||
NODE **result = (NODE **)h;
|
NODE **result = (NODE **)h;
|
||||||
|
node->nd_alen = 2;
|
||||||
|
node->nd_next->nd_end = node->nd_next;
|
||||||
|
node->nd_next->nd_next = 0;
|
||||||
if (*result)
|
if (*result)
|
||||||
list_concat(*result, node);
|
list_concat(*result, node);
|
||||||
else
|
else
|
||||||
|
@ -9619,9 +9622,6 @@ remove_duplicate_keys(struct parser_params *parser, NODE *hash)
|
||||||
NODE *next = value->nd_next;
|
NODE *next = value->nd_next;
|
||||||
VALUE key = (VALUE)head;
|
VALUE key = (VALUE)head;
|
||||||
st_data_t data;
|
st_data_t data;
|
||||||
hash->nd_alen = 2;
|
|
||||||
value->nd_end = value;
|
|
||||||
value->nd_next = 0;
|
|
||||||
if (nd_type(head) == NODE_LIT &&
|
if (nd_type(head) == NODE_LIT &&
|
||||||
st_lookup(literal_keys, (key = head->nd_lit), &data)) {
|
st_lookup(literal_keys, (key = head->nd_lit), &data)) {
|
||||||
rb_compile_warn(ruby_sourcefile, nd_line((NODE *)data),
|
rb_compile_warn(ruby_sourcefile, nd_line((NODE *)data),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче