diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index e7889ed79fccd..012d3c500a306 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -2815,6 +2815,10 @@ GenTree* Compiler::impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig) CORINFO_CLASS_HANDLE fieldOwnerHnd = info.compCompHnd->getFieldClass(fieldToken); + // We're expanding RuntimeHelpers.CreateSpan((RuntimeFieldHandle)0x...), thus, we need to + // statically initialize the class containing that RuntimeFieldHandle + info.compCompHnd->initClass(fieldToken, info.compMethodHnd, impTokenLookupContextHandle); + CORINFO_CLASS_HANDLE fieldClsHnd; var_types fieldElementType = JITtype2varType(info.compCompHnd->getFieldType(fieldToken, &fieldClsHnd, fieldOwnerHnd));