Skip to content

Commit e80ef86

Browse files
authored
JIT: Don't set patchpoints in methods with CORINFO_DEBUG_CODE (#88227)
In #88199 the debugger is overriding some jit flags, but has left other flags set that confuse the jit: both `TIER0` and `DEBUG_CODE` end uip set so one part of the jit used logic appropriate for `TIER0` and another part did not. The JIT ended up creating a patchpoint for OSR in a method with localloc and this combination is not supported by OSR and lead to a crash. Harden the jit so if the runtime asks for debuggable code, the jit will never generate patchpoints.
1 parent 8b7b5ef commit e80ef86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coreclr/jit/importer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5810,7 +5810,8 @@ void Compiler::impImportBlockCode(BasicBlock* block)
58105810

58115811
#ifdef FEATURE_ON_STACK_REPLACEMENT
58125812

5813-
bool enablePatchpoints = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && (JitConfig.TC_OnStackReplacement() > 0);
5813+
bool enablePatchpoints =
5814+
!opts.compDbgCode && opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && (JitConfig.TC_OnStackReplacement() > 0);
58145815

58155816
#ifdef DEBUG
58165817

0 commit comments

Comments
 (0)