aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-09 14:09:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-09 14:09:58 +0000
commit48898a4898817a42e4a6e790359eed8f1651dfa3 (patch)
treeed4ca7145777ab91b3a3c33dd4693fb55ffb9465 /test/ruby/test_optimization.rb
parent3eaac84f4152137d776ca8b64e08af38e62fa364 (diff)
downloadruby-48898a4898817a42e4a6e790359eed8f1651dfa3.tar.gz
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/trunk@62333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_optimization.rb')
-rw-r--r--test/ruby/test_optimization.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index ac3440a665..6e463e1863 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -709,6 +709,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