summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2025-06-18 16:52:27 -0700
committerJohn Hawthorn <[email protected]>2025-06-18 20:54:01 -0700
commit912edb47162626bf039ee649c8a1d05b2d7410ef ()
tree9ef8fb0b05ca1612ab283dc9dd3891551eafcb73 /variable.c
parentbfb14c2be91735d5cdd2b5cefe7f19d46a5b4f4a (diff)
Fix missing write barrier on class fields
Found by wbcheck klass = Class.new 200.times do |iv| klass.instance_variable_set("@_iv_#{iv}", Object.new) end
Notes: Merged: https://.com/ruby/ruby/pull/13654
-rw-r--r--variable.c7
1 files changed, 6 insertions, 1 deletions
@@ -4726,7 +4726,12 @@ class_fields_ivar_set(VALUE klass, VALUE fields_obj, ID id, VALUE val, bool conc
// so that we're embedded as long as possible.
fields_obj = rb_imemo_fields_new(rb_singleton_class(klass), next_capacity);
if (original_fields_obj) {
- MEMCPY(rb_imemo_fields_ptr(fields_obj), rb_imemo_fields_ptr(original_fields_obj), VALUE, RSHAPE_LEN(current_shape_id));
}
}