diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 075e0e8d540f93..af6fa9769a4551 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -9936,9 +9936,10 @@ void Compiler::impImportBlockCode(BasicBlock* block) impPushOnStack(gtNewLclvNode(lclNum, TYP_REF), tiRetVal); #ifdef DEBUG - // Under SPMI, look up info we might ask for if we stack allocate this array + // Under SPMI, look up info we might ask for if we stack allocate this array, + // but only if we know the precise type // - if (JitConfig.EnableExtraSuperPmiQueries()) + if (JitConfig.EnableExtraSuperPmiQueries() && !eeIsSharedInst(resolvedToken.hClass)) { void* pEmbedClsHnd; info.compCompHnd->embedClassHandle(resolvedToken.hClass, &pEmbedClsHnd);