diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 27550eac30073a..9cb0569f7e0601 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -9814,9 +9814,9 @@ void Compiler::impImportBlockCode(BasicBlock* block) // Field's type is a byref-like struct -> address is not on the heap. indirFlags |= GTF_IND_TGT_NOT_HEAP; } - else + else if ((fieldInfo.fieldFlags & CORINFO_FLG_FIELD_STATIC) == 0) { - // Field's owner is a byref-like struct -> address is not on the heap. + // Field's owner is a byref-like struct and the field is not static -> address is not on the heap. CORINFO_CLASS_HANDLE fldOwner = info.compCompHnd->getFieldClass(resolvedToken.hField); if ((fldOwner != NO_CLASS_HANDLE) && eeIsByrefLike(fldOwner)) {