From 8aeff36d34f8ecf89c5bdf3925a68b5c57614b02 Mon Sep 17 00:00:00 2001 From: Aman Khalid Date: Wed, 31 Jul 2024 15:09:11 +0000 Subject: [PATCH] JIT: Skip GT_LCL_FLD stress if GTF_VAR_CONTEXT is set (#105726) --- src/coreclr/jit/lclvars.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index ad5926522e41d..092aa7f669e0f 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -8078,6 +8078,14 @@ Compiler::fgWalkResult Compiler::lvaStressLclFldCB(GenTree** pTree, fgWalkData* return WALK_CONTINUE; } + // Ignore locals used in runtime lookups + if ((tree->gtFlags & GTF_VAR_CONTEXT) != 0) + { + assert(tree->OperIs(GT_LCL_VAR)); + varDsc->lvNoLclFldStress = true; + return WALK_CONTINUE; + } + // Ignore arguments and temps if (varDsc->lvIsParam || lclNum >= pComp->info.compLocalsCount) {