Remove bogus fgCurHeapDef guard
authorJoseph Tremoulet <jotrem@microsoft.com>
Wed, 11 Jan 2017 20:59:29 +0000 (15:59 -0500)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 11 Jan 2017 20:59:29 +0000 (15:59 -0500)
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

src/coreclr/src/jit/liveness.cpp

index 60ef1a1..0d47716 100644 (file)
@@ -265,10 +265,7 @@ void Compiler::fgPerNodeLocalVarLiveness(GenTree* tree)
                 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
                 {