Skip to content

Commit

Permalink
JIT: Don't set patchpoints in methods with CORINFO_DEBUG_CODE (#88227)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AndyAyersMS authored Jul 1, 2023
1 parent 8b7b5ef commit e80ef86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5810,7 +5810,8 @@ void Compiler::impImportBlockCode(BasicBlock* block)

#ifdef FEATURE_ON_STACK_REPLACEMENT

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

#ifdef DEBUG

Expand Down

0 comments on commit e80ef86

Please sign in to comment.