[Jit] fix DevDiv_499435 (#14179)
authorSergey Andreenko <seandree@microsoft.com>
Wed, 27 Sep 2017 19:00:33 +0000 (12:00 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Sep 2017 19:00:33 +0000 (12:00 -0700)
fix DevDiv_499435

src/jit/morph.cpp

index 6c9e3ad..1d04913 100644 (file)
@@ -14285,6 +14285,13 @@ GenTreePtr Compiler::fgMorphSmpOp(GenTreePtr tree, MorphAddrContext* mac)
                     /* Both tree and op1 are GT_COMMA nodes */
                     /* Change the tree's op1 to the throw node: op1->gtOp.gtOp1 */
                     tree->gtOp.gtOp1 = throwNode;
+
+                    // Possibly reset the assignment flag
+                    if (((throwNode->gtFlags & GTF_ASG) == 0) && ((op2 == nullptr) || ((op2->gtFlags & GTF_ASG) == 0)))
+                    {
+                        tree->gtFlags &= ~GTF_ASG;
+                    }
+
                     return tree;
                 }
                 else if (oper != GT_NOP)