We should set fgCurHeapUse when visiting a heap use regardless of whether
fgCurHeapDef is set, because we haven't proven that the def writes all
memory that the use might read. This should have been included in dotnet/coreclr#8757
but somehow slipped through.
Commit migrated from https://github.com/dotnet/coreclr/commit/
334cf4e004367b8c0c717fe3974ae008ecec0f62
GenTreePtr addrArg = tree->gtOp.gtOp1->gtEffectiveVal(/*commaOnly*/ true);
if (!addrArg->DefinesLocalAddr(this, /*width doesn't matter*/ 0, &dummyLclVarTree, &dummyIsEntire))
{
- if (!fgCurHeapDef)
- {
- fgCurHeapUse = true;
- }
+ fgCurHeapUse = true;
}
else
{