Skip to content

Commit

Permalink
[mono][interp] Add missing GC wbarriers for static field stores in co…
Browse files Browse the repository at this point in the history
…llectible assemblies
  • Loading branch information
BrzVlad committed Apr 24, 2024
1 parent 245859e commit af0d6eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mono/mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -4644,7 +4644,12 @@ interp_emit_sfld_access (TransformData *td, MonoClassField *field, MonoClass *fi
}
interp_ins_set_dreg (td->last_ins, td->sp [-1].var);
} else {
if (G_UNLIKELY (m_field_is_from_update (field)) && (mt == MINT_TYPE_VT || mt == MINT_TYPE_O)) {
// Fields from hotreload update and fields from collectible assemblies are not
// stored inside fixed gc roots but rather in other objects. This means that
// storing into these fields requires write barriers.
if ((mt == MINT_TYPE_VT || mt == MINT_TYPE_O) &&
(m_field_is_from_update (field) ||
mono_image_get_alc (m_class_get_image (m_field_get_parent (field)))->collectible)) {
interp_emit_ldsflda (td, field, error);
return_if_nok (error);
interp_emit_stobj (td, field_class, TRUE);
Expand Down

0 comments on commit af0d6eb

Please sign in to comment.