Address late feedback for #39320. (#39387)
authorEugene Rozenfeld <erozen@microsoft.com>
Fri, 17 Jul 2020 02:50:57 +0000 (19:50 -0700)
committerGitHub <noreply@github.com>
Fri, 17 Jul 2020 02:50:57 +0000 (19:50 -0700)
src/coreclr/src/jit/flowgraph.cpp

index ab39e2c..e870a8f 100644 (file)
@@ -15335,18 +15335,18 @@ bool Compiler::fgOptimizeBranch(BasicBlock* bJump)
         // Clone/substitute the expression.
         Statement* stmt = gtCloneStmt(curStmt);
 
-        if (fgStmtListThreaded)
-        {
-            gtSetStmtInfo(stmt);
-            fgSetStmtSeq(stmt);
-        }
-
         // cloneExpr doesn't handle everything.
         if (stmt == nullptr)
         {
             return false;
         }
 
+        if (fgStmtListThreaded)
+        {
+            gtSetStmtInfo(stmt);
+            fgSetStmtSeq(stmt);
+        }
+
         /* Append the expression to our list */
 
         if (newStmtList != nullptr)