The check for the case where a barrier is not required when writing to a
local variable needs to include the LocalVarAddr and lclVar address
expression cases.
Update per comments
Commit migrated from https://github.com/dotnet/coreclr/commit/
39ac49632a499877db8b8656dc63d147c7a8fe39
}
}
}
- if (tgtAddr->OperGet() == GT_ADDR && tgtAddr->gtOp.gtOp1->OperGet() == GT_LCL_VAR)
+ if (tgtAddr->IsLocalAddrExpr() != nullptr)
{
// No need for a GC barrier when writing to a local variable.
return GCInfo::WBF_NoBarrier;