<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby, branch v3_4_5</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 2e7e78cd590d20aa9d41422e96302f3edd73f623: [Backport #21440]</title>
<updated>2025-07-14T21:30:53+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2af8f305542fd20537435046c1a558db5b2cacc5'/>
<id>2af8f305542fd20537435046c1a558db5b2cacc5</id>
<content type='text'>
	[Bug #21440] Stop caching member list in frozen Data/Struct class
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21440] Stop caching member list in frozen Data/Struct class
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 1d94a9e1a4351e01f851dad250ba97dad859ee70: [Backport #21447]</title>
<updated>2025-07-14T21:29:12+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:29:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f0f97886fc0ef805835f0a0d7553e2a8abf988de'/>
<id>f0f97886fc0ef805835f0a0d7553e2a8abf988de</id>
<content type='text'>
	Fix handling of PM_CONSTANT_PATH_NODE node in keyword arguments with ARGS_SPLAT

	This was handled correctly in parse.y (NODE_COLON2), but not in
	prism. This wasn't caught earlier, because I only added tests for
	the optimized case and not the unoptimized case. Add tests for
	the unoptimized case.

	In code terms:

	```ruby
	m(*a, kw: lvar::X)     # Does not require allocation for *a
	m(*a, kw: method()::X) # Requires allocation for *a
	```

	This commit fixes the second case when prism is used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix handling of PM_CONSTANT_PATH_NODE node in keyword arguments with ARGS_SPLAT

	This was handled correctly in parse.y (NODE_COLON2), but not in
	prism. This wasn't caught earlier, because I only added tests for
	the optimized case and not the unoptimized case. Add tests for
	the unoptimized case.

	In code terms:

	```ruby
	m(*a, kw: lvar::X)     # Does not require allocation for *a
	m(*a, kw: method()::X) # Requires allocation for *a
	```

	This commit fixes the second case when prism is used.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) fa85d23ff4a02985ebfe0716b0ff768f5b4fe13d: [Backport #21380]</title>
<updated>2025-07-14T21:23:45+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:23:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fee92000fe96ac2dba0e87c5ed60c7440c8e2117'/>
<id>fee92000fe96ac2dba0e87c5ed60c7440c8e2117</id>
<content type='text'>
	[Bug #21380] Prohibit modification in String#split block

	Reported at https://hackerone.com/reports/3163876
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21380] Prohibit modification in String#split block

	Reported at https://hackerone.com/reports/3163876
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "merge revision(s) ff222ac27afe712ef6ec2bb74c81cdde1a1fa176: [Backport #21370]"</title>
<updated>2025-07-14T21:17:12+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:16:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3a06b3d9f51bc4a3eef5fbaa035595ed34d65eba'/>
<id>3a06b3d9f51bc4a3eef5fbaa035595ed34d65eba</id>
<content type='text'>
This reverts commit acb19e8707093593e967b6af03d92da5c570ffc6.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit acb19e8707093593e967b6af03d92da5c570ffc6.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 097d742a1ed53afb91e83aef01365d68b763357b: [Backport #20009]</title>
<updated>2025-07-14T21:14:34+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:14:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e68adac82a58e1b4a63d9e31047b59cbd515c54c'/>
<id>e68adac82a58e1b4a63d9e31047b59cbd515c54c</id>
<content type='text'>
	[Bug #20009] Support marshaling non-ASCII name class/module
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20009] Support marshaling non-ASCII name class/module
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 5ec9a392cdf7f971221dc073dd466bce877d8acb: [Backport #21439]</title>
<updated>2025-07-14T21:04:20+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T21:04:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=585469aff3de855a9f3db8e51f12bf87300981af'/>
<id>585469aff3de855a9f3db8e51f12bf87300981af</id>
<content type='text'>
	[Bug #21439] Fix `PM_SPLAT_NODE` compilation error in for loops (#13597)

	[Bug #21439] Fix PM_SPLAT_NODE compilation error in for loops

	This commit fixes a crash that occurred when using splat nodes (*) as
	the index variable in for loops. The error "Unexpected node type for
	index in for node: PM_SPLAT_NODE" was thrown because the compiler
	didn't know how to handle splat nodes in this context.

	The fix allows code like `for *x in [[1,2], [3,4]]` to compile and
	execute correctly, where the splat collects each sub-array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21439] Fix `PM_SPLAT_NODE` compilation error in for loops (#13597)

	[Bug #21439] Fix PM_SPLAT_NODE compilation error in for loops

	This commit fixes a crash that occurred when using splat nodes (*) as
	the index variable in for loops. The error "Unexpected node type for
	index in for node: PM_SPLAT_NODE" was thrown because the compiler
	didn't know how to handle splat nodes in this context.

	The fix allows code like `for *x in [[1,2], [3,4]]` to compile and
	execute correctly, where the splat collects each sub-array.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 34b407a4a89e69dd04f692e2b29efa2816d4664a: [Backport #21394]</title>
<updated>2025-07-14T20:55:05+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T20:55:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c397c2d177a0b7fd13b69c5109418fbe1f9eccd1'/>
<id>c397c2d177a0b7fd13b69c5109418fbe1f9eccd1</id>
<content type='text'>
	Fix memory leak in Prism's RubyVM::InstructionSequence.new

	[Bug #21394]

	There are two ways to make RubyVM::InstructionSequence.new raise which
	would cause the options-&gt;scopes to leak memory:

	1. Passing in any (non T_FILE) object where the to_str raises.
	2. Passing in a T_FILE object where String#initialize_dup raises. This is
	   because rb_io_path dups the string.

	Example 1:

	    10.times do
	      100_000.times do
	        RubyVM::InstructionSequence.new(nil)
	      rescue TypeError
	      end

	      puts `ps -o rss= -p #{$$}`
	    end

	Before:

	    13392
	    17104
	    20256
	    23920
	    27264
	    30432
	    33584
	    36752
	    40032
	    43232

	After:

	    9392
	    11072
	    11648
	    11648
	    11648
	    11712
	    11712
	    11712
	    11744
	    11744

	Example 2:

	    require "tempfile"

	    MyError = Class.new(StandardError)
	    String.prepend(Module.new do
	      def initialize_dup(_)
	        if $raise_on_dup
	          raise MyError
	        else
	          super
	        end
	      end
	    end)

	    Tempfile.create do |f|
	      10.times do
	        100_000.times do
	          $raise_on_dup = true
	          RubyVM::InstructionSequence.new(f)
	        rescue MyError
	        else
	          raise "MyError was not raised during RubyVM::InstructionSequence.new"
	        end

	        puts `ps -o rss= -p #{$$}`
	      ensure
	        $raise_on_dup = false
	      end
	    end

	Before:

	    14080
	    18512
	    22000
	    25184
	    28320
	    31600
	    34736
	    37904
	    41088
	    44256

	After:

	    12016
	    12464
	    12880
	    12880
	    12880
	    12912
	    12912
	    12912
	    12912
	    12912
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix memory leak in Prism's RubyVM::InstructionSequence.new

	[Bug #21394]

	There are two ways to make RubyVM::InstructionSequence.new raise which
	would cause the options-&gt;scopes to leak memory:

	1. Passing in any (non T_FILE) object where the to_str raises.
	2. Passing in a T_FILE object where String#initialize_dup raises. This is
	   because rb_io_path dups the string.

	Example 1:

	    10.times do
	      100_000.times do
	        RubyVM::InstructionSequence.new(nil)
	      rescue TypeError
	      end

	      puts `ps -o rss= -p #{$$}`
	    end

	Before:

	    13392
	    17104
	    20256
	    23920
	    27264
	    30432
	    33584
	    36752
	    40032
	    43232

	After:

	    9392
	    11072
	    11648
	    11648
	    11648
	    11712
	    11712
	    11712
	    11744
	    11744

	Example 2:

	    require "tempfile"

	    MyError = Class.new(StandardError)
	    String.prepend(Module.new do
	      def initialize_dup(_)
	        if $raise_on_dup
	          raise MyError
	        else
	          super
	        end
	      end
	    end)

	    Tempfile.create do |f|
	      10.times do
	        100_000.times do
	          $raise_on_dup = true
	          RubyVM::InstructionSequence.new(f)
	        rescue MyError
	        else
	          raise "MyError was not raised during RubyVM::InstructionSequence.new"
	        end

	        puts `ps -o rss= -p #{$$}`
	      ensure
	        $raise_on_dup = false
	      end
	    end

	Before:

	    14080
	    18512
	    22000
	    25184
	    28320
	    31600
	    34736
	    37904
	    41088
	    44256

	After:

	    12016
	    12464
	    12880
	    12880
	    12880
	    12912
	    12912
	    12912
	    12912
	    12912
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) ff222ac27afe712ef6ec2bb74c81cdde1a1fa176: [Backport #21370]</title>
<updated>2025-07-14T20:54:31+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T20:54:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=acb19e8707093593e967b6af03d92da5c570ffc6'/>
<id>acb19e8707093593e967b6af03d92da5c570ffc6</id>
<content type='text'>
	compile.c: Handle anonymous variables in `outer_variable_cmp`

	[Bug #21370]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	compile.c: Handle anonymous variables in `outer_variable_cmp`

	[Bug #21370]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 9f91f3617bab2ee220d298ddb874ef73b10dac23: [Backport #21383]</title>
<updated>2025-07-14T20:53:56+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T20:53:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cdb039d3e4f76ee01744814e5f08395835fa8e63'/>
<id>cdb039d3e4f76ee01744814e5f08395835fa8e63</id>
<content type='text'>
	Fix memory leak with invalid yield in prism

	[Bug #21383]

	The following script leaks memory:

	    10.times do
	      20_000.times do
	        eval("class C; yield; end")
	      rescue SyntaxError
	      end

	      puts `ps -o rss= -p #{$$}`
	    end

	Before:

	    16464
	    25536
	    29424
	    35904
	    39552
	    44576
	    46736
	    51600
	    56096
	    59824

	After:

	    13488
	    16160
	    18240
	    20528
	    19760
	    21808
	    21680
	    22272
	    22064
	    22336
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix memory leak with invalid yield in prism

	[Bug #21383]

	The following script leaks memory:

	    10.times do
	      20_000.times do
	        eval("class C; yield; end")
	      rescue SyntaxError
	      end

	      puts `ps -o rss= -p #{$$}`
	    end

	Before:

	    16464
	    25536
	    29424
	    35904
	    39552
	    44576
	    46736
	    51600
	    56096
	    59824

	After:

	    13488
	    16160
	    18240
	    20528
	    19760
	    21808
	    21680
	    22272
	    22064
	    22336
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 056497319658cbefe22351c6ec5c9fa6e4df72bd: [Backport #21357]</title>
<updated>2025-07-14T20:52:11+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-07-14T20:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1bdae3404b2918a8823d2fbac2f9e30f778aa1c9'/>
<id>1bdae3404b2918a8823d2fbac2f9e30f778aa1c9</id>
<content type='text'>
	[Bug #21357] Fix crash in Hash#merge with block

	Prior to https://github.com/ruby/ruby/commit/49b306ecb9e2e9e06e0b1590bacc5f4b38169c3c
	the `optional_arg` passed from `rb_hash_update_block_i` to `tbl_update`
	was a hash value (i.e. a VALUE). After that commit it changed to an
	`update_call_args`.

	If the block sets or changes the value, `tbl_update_modify` will set the
	`arg.value` back to an actual value and we won't crash. But in the case
	where the block returns the original value we end up calling
	`RB_OBJ_WRITTEN` with the `update_call_args` which is not expected and
	may crash.

	`arg.value` appears to only be used to pass to `RB_OBJ_WRITTEN` (others
	who need the `update_call_args` get it from `arg.arg`), so I don't think
	it needs to be set to anything upfront. And `tbl_update_modify` will set
	the `arg.value` in the cases we need the write barrier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21357] Fix crash in Hash#merge with block

	Prior to https://github.com/ruby/ruby/commit/49b306ecb9e2e9e06e0b1590bacc5f4b38169c3c
	the `optional_arg` passed from `rb_hash_update_block_i` to `tbl_update`
	was a hash value (i.e. a VALUE). After that commit it changed to an
	`update_call_args`.

	If the block sets or changes the value, `tbl_update_modify` will set the
	`arg.value` back to an actual value and we won't crash. But in the case
	where the block returns the original value we end up calling
	`RB_OBJ_WRITTEN` with the `update_call_args` which is not expected and
	may crash.

	`arg.value` appears to only be used to pass to `RB_OBJ_WRITTEN` (others
	who need the `update_call_args` get it from `arg.arg`), so I don't think
	it needs to be set to anything upfront. And `tbl_update_modify` will set
	the `arg.value` in the cases we need the write barrier.
</pre>
</div>
</content>
</entry>
</feed>
