Skip to content

Commit

Permalink
JIT: ensure fgFirstBB has appropriate flags (#40038)
Browse files Browse the repository at this point in the history
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 #39023 for details.
  • Loading branch information
AndyAyersMS authored Jul 29, 2020
1 parent bb82d67 commit 5c344f6
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 5c344f6

Please sign in to comment.