diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-16 07:32:11 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-16 07:32:11 +0000 |
commit | 53859b791ddc95577e464418725c278e60b02afb (patch) | |
tree | 202648ee107f6dbbb6f3e49dcf498fd066c747a8 /compile.c | |
parent | 0397ed451838eda288b5df45b4e2431b9aab1a61 (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_5@62420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -6181,7 +6181,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in if (liseq->body->param.flags.has_rest) { /* rest argument */ int idx = liseq->body->local_table_size - liseq->body->param.rest_start; + ADD_GETLOCAL(args, line, idx, lvar_level); + ADD_INSN1(args, line, splatarray, Qfalse); argc = liseq->body->param.rest_start + 1; flag |= VM_CALL_ARGS_SPLAT; |