From 0b46bbf76dfbd018a1d6272ca4017cd4f69ec646 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 28 Mar 2018 05:46:13 +0000 Subject: merge revision(s) 61603: [Backport #14279] check array for zsuper. [Bug #14279] * compile.c (iseq_compile_each0): for zsuper (NODE_ZSUPER), we need to check given argument is Array or not. * test/ruby/test_super.rb: add a test for this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_super.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 2764cf534b..16a161df43 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -544,4 +544,20 @@ class TestSuper < Test::Unit::TestCase c.new } end + + class TestFor_super_with_modified_rest_parameter_base + def foo *args + args + end + end + + class TestFor_super_with_modified_rest_parameter < TestFor_super_with_modified_rest_parameter_base + def foo *args + args = 13 + super + end + end + def test_super_with_modified_rest_parameter + assert_equal [13], TestFor_super_with_modified_rest_parameter.new.foo + end end -- cgit v1.2.3