You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include ivar name and class in class/module ivar-set isolation violation
The set-side warning now reports which instance variable and class
triggered the violation (e.g. "@foo from Foo"), matching the format of
the read-side warning and making each violation uniquely identifiable.
Assisted-By: devx/1467c1c0-7d14-4cf6-926c-dd31cac15fdc
if (UNLIKELY(rb_ractor_isolation_check_active())) {
1205
1205
if (rb_is_instance_id(id)) { // check only normal ivars
1206
-
rb_ractor_isolation_violation("can not set instance variables of classes/modules by non-main Ractors");
1206
+
/* Pass rb_class_path() rather than the class itself to avoid
1207
+
* marking the class as shared while building the message. */
1208
+
rb_ractor_isolation_violation("can not set instance variables of classes/modules by non-main Ractors (%"PRIsVALUE" from %"PRIsVALUE")", rb_id2str(id), rb_class_path(obj));
1207
1209
}
1208
1210
}
1209
1211
}
@@ -1674,7 +1676,7 @@ rb_ivar_delete(VALUE obj, ID id, VALUE undef)
1674
1676
switch(type) {
1675
1677
caseT_CLASS:
1676
1678
caseT_MODULE:
1677
-
IVAR_ACCESSOR_SHOULD_BE_MAIN_RACTOR(id);
1679
+
IVAR_ACCESSOR_SHOULD_BE_MAIN_RACTOR(obj, id);
1678
1680
1679
1681
fields_obj=RCLASS_WRITABLE_FIELDS_OBJ(obj);
1680
1682
if (rb_multi_ractor_p()) {
@@ -2066,7 +2068,7 @@ ivar_set(VALUE obj, ID id, VALUE val)
0 commit comments