summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2017-05-30 16:02:20 -0700
committerGitHub <noreply@github.com>2017-05-30 16:02:20 -0700
commit0e3494f208edb21d40e36374dab718e08a8502c8 (patch)
tree22e368c3b58363e1d989d3ad9d2284b4f6ee69d1
parentd67545d8cbd1962221e5bc7ce04bba69abfdfac1 (diff)
downloadcoreclr-0e3494f208edb21d40e36374dab718e08a8502c8.tar.gz
coreclr-0e3494f208edb21d40e36374dab718e08a8502c8.tar.bz2
coreclr-0e3494f208edb21d40e36374dab718e08a8502c8.zip
Skip cast nodes for the tail call check. (#11986)
Fix #11983
-rw-r--r--src/jit/morph.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index 0608dcd85e..b8c269c509 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -8137,8 +8137,16 @@ GenTreePtr Compiler::fgMorphCall(GenTreeCall* call)
if (stmtExpr->gtOper == GT_ASG && info.compRetType != TYP_VOID)
{
noway_assert(stmtExpr->gtGetOp1()->OperIsLocal());
+
+ GenTreePtr treeWithLcl = retExpr->gtGetOp1();
+ while (treeWithLcl->gtOper == GT_CAST)
+ {
+ noway_assert(!treeWithLcl->gtOverflow());
+ treeWithLcl = treeWithLcl->gtGetOp1();
+ }
+
noway_assert(stmtExpr->gtGetOp1()->AsLclVarCommon()->gtLclNum ==
- retExpr->gtGetOp1()->AsLclVarCommon()->gtLclNum);
+ treeWithLcl->AsLclVarCommon()->gtLclNum);
}
fgRemoveStmt(compCurBB, nextMorphStmt);