diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 05:46:13 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 05:46:13 +0000 |
commit | 0b46bbf76dfbd018a1d6272ca4017cd4f69ec646 (patch) | |
tree | a2dc7823d3fc61a64890a3fcc5eb0eda31003371 /compile.c | |
parent | 08987d3105c72cf2583c5df27bfc40d1724137ec (diff) |
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
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5074,7 +5074,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) if (liseq->body->param.flags.has_rest) { /* rest argument */ int idx = liseq->body->local_size - liseq->body->param.rest_start; + ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level)); + ADD_INSN1(args, line, splatarray, Qfalse); + argc = liseq->body->param.rest_start + 1; flag |= VM_CALL_ARGS_SPLAT; } |