diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-19 00:45:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-19 00:45:55 +0000 |
commit | caa663d852d1e961c117113b1b4ade24668d77a0 (patch) | |
tree | b018ad01a51abbec91a4e65fc4ded887236b9c49 /test | |
parent | 22aa8a077cf50d75538ef0cc196ba2f23000e4a7 (diff) | |
download | ruby-caa663d852d1e961c117113b1b4ade24668d77a0.tar.gz |
compile.c: side effect in splat
* compile.c (compile_array): splat which may have side effects
should be compiled even if the result will be popped.
[ruby-core:84340] [Bug #14201]
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_optimization.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 0d049c3b88..160f439b36 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -702,4 +702,10 @@ class TestRubyOptimization < Test::Unit::TestCase } END end + + def test_side_effect_in_popped_splat + bug = '[ruby-core:84340] [Bug #14201]' + eval("{**(bug = nil; {})};42") + assert_nil(bug) + end end |