Skip to content

Commit

Permalink
Port JIT fix to Preview 8: ensure fgFirstBB has appropriate flags
Browse files Browse the repository at this point in the history
Port of dotnet#40038 to Preview 8.

Fix dotnet#39023

Release jits might sometimes generate bad GC info.

Mysterious intermittent crashes. Without this fix jit GC
info generation for some methods is non-deterministically bad.

Yes, problem does not occur in 3.1.

Very low.
  • Loading branch information
AndyAyersMS committed Jul 29, 2020
1 parent e26443a commit dfccb3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/coreclr/src/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ void Compiler::fgInit()
#ifdef FEATURE_SIMD
fgPreviousCandidateSIMDFieldAsgStmt = nullptr;
#endif

fgHasSwitch = false;
}

bool Compiler::fgHaveProfileData()
Expand Down Expand Up @@ -476,7 +478,8 @@ void Compiler::fgEnsureFirstBBisScratch()

noway_assert(fgLastBB != nullptr);

block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED);
// Set the expected flags
block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED | BBF_JMP_TARGET | BBF_HAS_LABEL);

// This new first BB has an implicit ref, and no others.
block->bbRefs = 1;
Expand Down

0 comments on commit dfccb3f

Please sign in to comment.