Project

General

Profile

Bug #7665

keyrest argument overwrites the last element of rest argument

Added by nobu (Nobuyoshi Nakada) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:51278]

Description

=begin
Since r38657, this code
def foo(*args, **opt)
p args, opt
end

foo("foo", "bar", zzz: 42)

shows
["foo", {:zzz=>42}]
{:zzz=>42}

but the first line should be (({["foo", "bar"]})).
=end


Related issues

Related to Ruby trunk - Bug #7630: Proc/block doesn't take keyword argumentsClosed2012-12-28

Associated revisions

Revision 8f1be270
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 38719
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

Revision 38719
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

Revision 38719
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

Revision 38719
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

Revision 38719
Added by nobu (Nobuyoshi Nakada) over 5 years ago

vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

History

#1 Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38719.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


vm_insnhelper.c: keyrest should not overwrite rest arg

  • vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args): set keyrest hash after making rest array, so that the last element will not be overwritten. [Bug #7665]

Also available in: Atom PDF