diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 3be08ec4950b0..e7550889d02e9 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -583,8 +583,8 @@ jobs: - jitpartialcompilation - jitpartialcompilation_pgo - jitobjectstackallocation - - jitgeneralizedpromotion - - jitgeneralizedpromotion_full + - jitphysicalpromotion + - jitphysicalpromotion_full ${{ if in(parameters.testGroup, 'jit-cfg') }}: scenarios: diff --git a/src/coreclr/jit/promotion.cpp b/src/coreclr/jit/promotion.cpp index 4cab8522818b5..c2d3f617af108 100644 --- a/src/coreclr/jit/promotion.cpp +++ b/src/coreclr/jit/promotion.cpp @@ -1099,12 +1099,11 @@ class ReplaceVisitor : public GenTreeVisitor if (srcDsc->lvPromoted) { - unsigned fieldLcl = m_compiler->lvaGetFieldLocal(srcDsc, srcOffs); - LclVarDsc* fieldLclDsc = m_compiler->lvaGetDesc(fieldLcl); + unsigned fieldLcl = m_compiler->lvaGetFieldLocal(srcDsc, srcOffs); - if (fieldLclDsc->lvType == rep->AccessType) + if ((fieldLcl != BAD_VAR_NUM) && (m_compiler->lvaGetDesc(fieldLcl)->lvType == rep->AccessType)) { - srcFld = m_compiler->gtNewLclvNode(fieldLcl, fieldLclDsc->lvType); + srcFld = m_compiler->gtNewLclvNode(fieldLcl, rep->AccessType); } } @@ -1300,6 +1299,11 @@ class ReplaceVisitor : public GenTreeVisitor // Overlap with last entry starting before offs. firstIndex--; } + else if (firstIndex >= replacements.size()) + { + // Starts after last replacement ends. + return false; + } } const Replacement& first = replacements[firstIndex];