Skip to content

Commit d1e0f32

Browse files
AndyAyersMSJacksondr5
authored andcommitted
JIT: ensure fgFirstBB has appropriate flags (dotnet#40038)
This fixes an issue where release jits might sometimes generate bad GC info. Keeping it minimal for now so we can consider servicing preview 8. See dotnet#39023 for details.
1 parent d311ae7 commit d1e0f32

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)