summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-12-03 10:47:28 +0100
committerJean Boussier <jean.boussier@gmail.com>2025-12-03 15:57:26 +0100
commitb78db63be4d078b7ac29c8e9fcb40cb20d232265 (patch)
tree2053caa572fab35862a998f7f4d419d75f0959ee
parent5770c186d1e9d8e7202c83763c9619faa1f4c97c (diff)
fstring_concurrent_set_create: only assert the string has no ivars
The NEWOBJ tracepoint can generate an object_id, that's alright, what we don't want is actual instance variables.
-rw-r--r--ext/-test-/tracepoint/tracepoint.c4
-rw-r--r--string.c2
2 files changed, 1 insertions, 5 deletions
diff --git a/ext/-test-/tracepoint/tracepoint.c b/ext/-test-/tracepoint/tracepoint.c
index 03887b1d5b..7f7aa24662 100644
--- a/ext/-test-/tracepoint/tracepoint.c
+++ b/ext/-test-/tracepoint/tracepoint.c
@@ -92,10 +92,6 @@ static void
on_newobj_event(VALUE tpval, void *data)
{
VALUE obj = rb_tracearg_object(rb_tracearg_from_tracepoint(tpval));
- if (RB_TYPE_P(obj, T_STRING)) {
- // Would fail !rb_obj_gen_fields_p(str) assertion in fstring_concurrent_set_create
- return;
- }
if (!rb_objspace_internal_object_p(obj)) rb_obj_id(obj);
}
diff --git a/string.c b/string.c
index 56c83ca2d5..0370fc5d1e 100644
--- a/string.c
+++ b/string.c
@@ -549,7 +549,7 @@ fstring_concurrent_set_create(VALUE str, void *data)
RUBY_ASSERT(RB_TYPE_P(str, T_STRING));
RUBY_ASSERT(OBJ_FROZEN(str));
RUBY_ASSERT(!FL_TEST_RAW(str, STR_FAKESTR));
- RUBY_ASSERT(!rb_obj_gen_fields_p(str));
+ RUBY_ASSERT(!rb_shape_obj_has_ivars(str));
RUBY_ASSERT(RBASIC_CLASS(str) == rb_cString);
RUBY_ASSERT(!rb_objspace_garbage_object_p(str));