Skip to content

Commit dfccb3f

Browse files
committed
Port JIT fix to Preview 8: ensure fgFirstBB has appropriate flags
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.
1 parent e26443a commit dfccb3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/coreclr/src/jit/flowgraph.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ void Compiler::fgInit()
175175
#ifdef FEATURE_SIMD
176176
fgPreviousCandidateSIMDFieldAsgStmt = nullptr;
177177
#endif
178+
179+
fgHasSwitch = false;
178180
}
179181

180182
bool Compiler::fgHaveProfileData()
@@ -476,7 +478,8 @@ void Compiler::fgEnsureFirstBBisScratch()
476478

477479
noway_assert(fgLastBB != nullptr);
478480

479-
block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED);
481+
// Set the expected flags
482+
block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED | BBF_JMP_TARGET | BBF_HAS_LABEL);
480483

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

0 commit comments

Comments
 (0)