From 584a02aaafda74c21d24dc4c5e223a2482c7fde3 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 13 Jul 2024 15:17:51 +0900 Subject: merge revision(s) d19d683a354530a27b4cbb049223f8dc70c75849: [Backport #20250] rb_obj_setup: do not copy RUBY_FL_SEEN_OBJ_ID [Bug #20250] We're seting up a new instance, so it never had an associated object_id. --- test/ruby/test_clone.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_clone.rb b/test/ruby/test_clone.rb index 216eaa39d2..775c9ed848 100644 --- a/test/ruby/test_clone.rb +++ b/test/ruby/test_clone.rb @@ -73,6 +73,13 @@ class TestClone < Test::Unit::TestCase assert_equal(cloned_obj.instance_variable_get(:@a), 1) end + def test_proc_obj_id_flag_reset + # [Bug #20250] + proc = Proc.new { } + proc.object_id + proc.clone.object_id # Would crash with RUBY_DEBUG=1 + end + def test_user_flags assert_separately([], <<-EOS) # -- cgit v1.2.3