From e6f6c77d1dc368e240dcb6b827e9e868efb6c06f Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 10 Jan 2016 11:57:51 +0000 Subject: compile.c: fix lhs splat in massign * compile.c (compile_massign_lhs): when index ends with splat, append rhs value to it like POSTARG, since VM_CALL_ARGS_SPLAT splats the last argument only. [ruby-core:72777] [Bug #11970] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_assignment.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_assignment.rb') diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb index d0f2fadeaa..daf1f0a9be 100644 --- a/test/ruby/test_assignment.rb +++ b/test/ruby/test_assignment.rb @@ -758,4 +758,12 @@ class TestAssignmentGen < Test::Unit::TestCase o = bug9448.new assert_equal("ok", o['current'] = "ok") end + + def test_massign_aref_lhs_splat + bug11970 = '[ruby-core:72777] [Bug #11970]' + h = {} + k = [:key] + h[*k], = ["ok", "ng"] + assert_equal("ok", h[:key], bug11970) + end end -- cgit v1.2.1