fix (#14837)
authorSergey Andreenko <seandree@microsoft.com>
Fri, 3 Nov 2017 03:08:27 +0000 (20:08 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Nov 2017 03:08:27 +0000 (20:08 -0700)
GTF_RET means that this flag is valid only for GTF_RET node, but this check was missed.
The issue was in collision between GTF_RET_MERGED and GTF_CALL_UNMANAGED.

src/jit/morph.cpp

index 9d6d0d3..a881d34 100644 (file)
@@ -16882,7 +16882,7 @@ void Compiler::fgMorphBlocks()
                 GenTreePtr last = (block->bbTreeList != nullptr) ? block->bbTreeList->gtPrev : nullptr;
                 GenTreePtr ret  = (last != nullptr) ? last->gtStmt.gtStmtExpr : nullptr;
 
-                if ((ret != nullptr) && ((ret->gtFlags & GTF_RET_MERGED) != 0))
+                if ((ret != nullptr) && (ret->OperGet() == GT_RETURN) && ((ret->gtFlags & GTF_RET_MERGED) != 0))
                 {
                     // This return was generated during epilog merging, so leave it alone
                 }