mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: fix GC problem of keyword rest argument
* parse.y (new_args_tail_gen): fix GC problem of keyword rest argument. the wrapped struct should be bound to the wrapping node before assignment of child nodes, to get rid of the case the children are referred by only the struct pointer which is not a subject of GC. [ruby-core:45744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b8b67c0b9d
commit
64ae33a18a
3 changed files with 16 additions and 1 deletions
|
@ -88,6 +88,10 @@ class TestSyntax < Test::Unit::TestCase
|
|||
assert_equal({}, o.kw, bug5989)
|
||||
assert_equal({foo: 1}, o.kw(foo: 1), bug5989)
|
||||
assert_equal({foo: 1, bar: 2}, o.kw(foo: 1, bar: 2), bug5989)
|
||||
EnvUtil.under_gc_stress do
|
||||
eval("def o.m(k: 0) k end")
|
||||
end
|
||||
assert_equal(42, o.m(k: 42), '[ruby-core:45744]')
|
||||
end
|
||||
|
||||
def test_keyword_splat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue