From 4556a9ec654406c1be43a0b0b3bff99e4d0ed3c1 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 29 Nov 2012 17:35:29 +0000 Subject: * compile.c (compile_array_): refix r37991 remove assertion: it is true only if type == COMPILE_ARRAY_TYPE_HASH. [ruby-dev:46658] [Bug #7466] * vm.c (m_core_hash_from_ary): add assertion instead of above. * vm.c (m_core_hash_merge_ary): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index ebb58bba8d..f061ae35da 100644 --- a/compile.c +++ b/compile.c @@ -2379,7 +2379,10 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, rb_ary_push(ary, node->nd_head->nd_lit); node = node->nd_next; } - while (node && nd_type(node->nd_head) == NODE_LIT) { + while (node && nd_type(node->nd_head) == NODE_LIT && + node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) { + rb_ary_push(ary, node->nd_head->nd_lit); + node = node->nd_next; rb_ary_push(ary, node->nd_head->nd_lit); node = node->nd_next; len++; -- cgit v1.2.3