summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2019-04-25 16:07:37 -0700
committerSergey Andreenko <seandree@microsoft.com>2019-04-25 16:45:03 -0700
commit6418fcf88c7014d564dbb38ea0d459d2da2645af (patch)
treebe8b91ca9db376e0c4ba39593308d4b50563cbe9 /src/jit
parent332bd2ec8a6bad66e1fb9b2dc3cf37e9e4d77727 (diff)
downloadcoreclr-6418fcf88c7014d564dbb38ea0d459d2da2645af.tar.gz
coreclr-6418fcf88c7014d564dbb38ea0d459d2da2645af.tar.bz2
coreclr-6418fcf88c7014d564dbb38ea0d459d2da2645af.zip
Fix parent's links in fgArgInfo in optAssertionProp_Update.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/assertionprop.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index 3d5e0edd15..61caa67cbb 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -3913,6 +3913,26 @@ 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;
+ if ((linkData.parent != nullptr) && linkData.parent->IsCall())
+ {
+ GenTreeCall* parentCall = linkData.parent->AsCall();
+ // Other functions can access call->fgArgInfo for other trees in the current statement
+ // before they are remorphed in optVNAssertionPropCurStmt, so we need to make sure
+ // that these links are updated.
+ fgArgInfo* argInfo = parentCall->fgArgInfo;
+ if (argInfo != nullptr)
+ {
+ for (unsigned i = 0; i < argInfo->ArgCount(); ++i)
+ {
+ fgArgTabEntry* argTabEntry = argInfo->ArgTable()[i];
+ if (argTabEntry->node == tree)
+ {
+ argTabEntry->node = newTree;
+ }
+ }
+ }
+ }
+
// Old tree should not be referenced anymore.
DEBUG_DESTROY_NODE(tree);
}