Narrow the assert in fgLateDevirtualization (#21163)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Thu, 22 Nov 2018 17:38:16 +0000 (18:38 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Nov 2018 17:38:16 +0000 (18:38 +0100)
As suggested by Andy in dotnet/corert#6601.

src/jit/flowgraph.cpp

index bcc818f..eba0c0b 100644 (file)
@@ -22399,9 +22399,9 @@ Compiler::fgWalkResult Compiler::fgLateDevirtualization(GenTree** pTree, fgWalkD
     // jit\Methodical\VT\callconv\_il_reljumper3 for x64 linux
     //
     // If so, just bail out here.
-    if ((parent != nullptr) && parent->OperGet() == GT_NOP)
+    if (tree == nullptr)
     {
-        assert(tree == nullptr);
+        assert((parent != nullptr) && parent->OperGet() == GT_NOP);
         return WALK_CONTINUE;
     }