From 526cc900922d5a316818bcacbf52b088f561a147 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 22 Feb 2018 11:01:13 +0000 Subject: merge revision(s) 62333: [Backport #14459] compile.c: popped hash * compile.c (compile_array): skip creating new hash if preceeding elements are popped all. [ruby-core:85486] [Bug #14459] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_optimization.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 5e17ea9032..d3eb531e1b 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -707,6 +707,11 @@ class TestRubyOptimization < Test::Unit::TestCase bug = '[ruby-core:84340] [Bug #14201]' eval("{**(bug = nil; {})};42") assert_nil(bug) + + bug = '[ruby-core:85486] [Bug #14459]' + h = {} + assert_equal(bug, eval('{ok: 42, **h}; bug')) + assert_equal(:ok, eval('{ok: bug = :ok, **h}; bug')) end def test_overwritten_blockparam -- cgit v1.2.3