Skip to content

Commit

Permalink
static init for RVA's holder in CreateSpan intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Jun 30, 2024
1 parent fcdb6db commit 3673427
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,10 @@ GenTree* Compiler::impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig)

CORINFO_CLASS_HANDLE fieldOwnerHnd = info.compCompHnd->getFieldClass(fieldToken);

// We're expanding RuntimeHelpers.CreateSpan<int>((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));
Expand Down

0 comments on commit 3673427

Please sign in to comment.