Return a missed field init to `GenTreeILOffset`. (dotnet/coreclr#26646)
authorSergey Andreenko <seandree@microsoft.com>
Wed, 11 Sep 2019 04:35:18 +0000 (21:35 -0700)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2019 04:35:18 +0000 (21:35 -0700)
That field is used only in dumping logic inside `genCodeForBBlist`, for some reason `gtDispTree` doesn't print it.

Commit migrated from https://github.com/dotnet/coreclr/commit/92e501f96c1403b7af4a155741a08ccbd0cbc1b4

src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/rationalize.cpp

index 290fc8c..d00e149 100644 (file)
@@ -5113,11 +5113,11 @@ struct GenTreeILOffset : public GenTree
     IL_OFFSET gtStmtLastILoffs; // instr offset at end of stmt
 #endif
 
-    GenTreeILOffset(IL_OFFSETX offset)
+    GenTreeILOffset(IL_OFFSETX offset DEBUGARG(IL_OFFSET lastOffset = BAD_IL_OFFSET))
         : GenTree(GT_IL_OFFSET, TYP_VOID)
         , gtStmtILoffsx(offset)
 #ifdef DEBUG
-        , gtStmtLastILoffs(BAD_IL_OFFSET)
+        , gtStmtLastILoffs(lastOffset)
 #endif
     {
     }
index 4240f52..1175cd4 100644 (file)
@@ -951,7 +951,8 @@ void Rationalizer::DoPhase()
             if (statement->gtStmtILoffsx != BAD_IL_OFFSET)
             {
                 assert(!statement->IsPhiDefnStmt());
-                GenTreeILOffset* ilOffset = new (comp, GT_IL_OFFSET) GenTreeILOffset(statement->gtStmtILoffsx);
+                GenTreeILOffset* ilOffset = new (comp, GT_IL_OFFSET)
+                    GenTreeILOffset(statement->gtStmtILoffsx DEBUGARG(statement->gtStmtLastILoffs));
                 BlockRange().InsertBefore(statement->gtStmtList, ilOffset);
             }