From d19d683a354530a27b4cbb049223f8dc70c75849 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 9 Feb 2024 13:54:06 +0100 Subject: 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. --- object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index a0783e9ef7..26ced2c8d8 100644 --- a/object.c +++ b/object.c @@ -120,7 +120,7 @@ rb_obj_reveal(VALUE obj, VALUE klass) VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type) { - VALUE ignored_flags = RUBY_FL_PROMOTED; + VALUE ignored_flags = RUBY_FL_PROMOTED | RUBY_FL_SEEN_OBJ_ID; RBASIC(obj)->flags = (type & ~ignored_flags) | (RBASIC(obj)->flags & ignored_flags); RBASIC_SET_CLASS(obj, klass); return obj; -- cgit v1.2.3