Destroy the old tree in `optAssertionProp_Update`.
authorSergey Andreenko <seandree@microsoft.com>
Wed, 27 Mar 2019 00:06:29 +0000 (17:06 -0700)
committerSergey Andreenko <seandree@microsoft.com>
Tue, 9 Apr 2019 20:59:27 +0000 (13:59 -0700)
Currently compiletion will fail with an assert because of `optPrepareTreeForReplacement`.

Commit migrated from https://github.com/dotnet/coreclr/commit/04c7fa63a52d4405298fd4053e7be137eac6a042

src/coreclr/src/jit/assertionprop.cpp

index 0e88310..7c4a0c3 100644 (file)
@@ -3923,6 +3923,8 @@ GenTree* Compiler::optAssertionProp_Update(GenTree* newTree, GenTree* tree, GenT
             // optAssertionPropMain(). It will reset the gtPrev and gtNext links for all nodes.
             newTree->gtNext = tree->gtNext;
 
+            // Old tree should not be referenced anymore.
+            DEBUG_DESTROY_NODE(tree);
         }
     }