File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -10344,10 +10344,13 @@ void Compiler::optRemoveRedundantZeroInits()
10344
10344
10345
10345
if (!bbInALoop || bbIsReturn)
10346
10346
{
10347
+ bool neverTracked = lclDsc->IsAddressExposed () || lclDsc->lvPinned ||
10348
+ (lclDsc->lvPromoted && varTypeIsStruct (lclDsc));
10349
+
10347
10350
if (BitVecOps::IsMember (&bitVecTraits, zeroInitLocals, lclNum) ||
10348
10351
(lclDsc->lvIsStructField &&
10349
10352
BitVecOps::IsMember (&bitVecTraits, zeroInitLocals, lclDsc->lvParentLcl )) ||
10350
- ((!lclDsc-> lvTracked || !isEntire) &&
10353
+ ((neverTracked || !isEntire) &&
10351
10354
!fgVarNeedsExplicitZeroInit (lclNum, bbInALoop, bbIsReturn)))
10352
10355
{
10353
10356
// We are guaranteed to have a zero initialization in the prolog or a
You can’t perform that action at this time.
0 commit comments