diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2020-02-13 14:27:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 14:27:34 -0800 |
commit | a86e825a641cf637d641e35f9ca88b65fe7ae801 (patch) | |
tree | 4d4ee4731f321963280a3720426475ebb4e25f6b /src | |
parent | 3800df91364fac77a85a512a9988c71302726e65 (diff) | |
download | coreclr-a86e825a641cf637d641e35f9ca88b65fe7ae801.tar.gz coreclr-a86e825a641cf637d641e35f9ca88b65fe7ae801.tar.bz2 coreclr-a86e825a641cf637d641e35f9ca88b65fe7ae801.zip |
Port fix for #1241 to 3.1 (#27983)
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/morph.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index dfea9e7832..5d5d471eb7 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -10199,6 +10199,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) GenTreeLclVarCommon* lclVarTree = nullptr; GenTreeLclVarCommon* srcLclVarTree = nullptr; unsigned destLclNum = BAD_VAR_NUM; + unsigned modifiedLclNum = BAD_VAR_NUM; LclVarDsc* destLclVar = nullptr; FieldSeqNode* destFldSeq = nullptr; bool destDoFldAsg = false; @@ -10214,10 +10215,11 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) { blockWidthIsConst = true; destOnStack = true; + modifiedLclNum = dest->AsLclVarCommon()->GetLclNum(); if (dest->gtOper == GT_LCL_VAR) { lclVarTree = dest->AsLclVarCommon(); - destLclNum = lclVarTree->gtLclNum; + destLclNum = modifiedLclNum; destLclVar = &lvaTable[destLclNum]; if (destLclVar->lvType == TYP_STRUCT) { @@ -10272,26 +10274,27 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) noway_assert(destAddr->TypeGet() == TYP_BYREF || destAddr->TypeGet() == TYP_I_IMPL); if (destAddr->IsLocalAddrExpr(this, &lclVarTree, &destFldSeq)) { - destOnStack = true; - destLclNum = lclVarTree->gtLclNum; - destLclVar = &lvaTable[destLclNum]; + destOnStack = true; + destLclNum = lclVarTree->GetLclNum(); + modifiedLclNum = destLclNum; + destLclVar = &lvaTable[destLclNum]; } } } - if (destLclVar != nullptr) - { #if LOCAL_ASSERTION_PROP - // Kill everything about destLclNum (and its field locals) - if (optLocalAssertionProp) + // Kill everything about modifiedLclNum (and its field locals) + if ((modifiedLclNum != BAD_VAR_NUM) && optLocalAssertionProp) + { + if (optAssertionCount > 0) { - if (optAssertionCount > 0) - { - fgKillDependentAssertions(destLclNum DEBUGARG(tree)); - } + fgKillDependentAssertions(modifiedLclNum DEBUGARG(tree)); } + } #endif // LOCAL_ASSERTION_PROP + if (destLclVar != nullptr) + { if (destLclVar->lvPromoted && blockWidthIsConst) { noway_assert(varTypeIsStruct(destLclVar)); |