mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
Use STR_SET_SHARED in str_duplicate_setup_heap
str_duplicate_setup_heap is missing a call to rb_gc_register_pinning_obj that STR_SET_SHARED correctly calls.
This commit is contained in:
parent
ea05c23ee8
commit
4129256214
Notes:
git
2026-01-01 02:57:28 +00:00
4
string.c
4
string.c
@ -1960,8 +1960,8 @@ str_duplicate_setup_heap(VALUE klass, VALUE str, VALUE dup)
|
||||
RUBY_ASSERT(RB_OBJ_FROZEN_RAW(root));
|
||||
|
||||
RSTRING(dup)->as.heap.ptr = RSTRING_PTR(str);
|
||||
FL_SET(root, STR_SHARED_ROOT);
|
||||
RB_OBJ_WRITE(dup, &RSTRING(dup)->as.heap.aux.shared, root);
|
||||
FL_SET_RAW(dup, RSTRING_NOEMBED);
|
||||
STR_SET_SHARED(dup, root);
|
||||
flags |= RSTRING_NOEMBED | STR_SHARED;
|
||||
|
||||
STR_SET_LEN(dup, RSTRING_LEN(str));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user