OSDN Git Service

fix PR4915, a crash in -debug mode.
authorChris Lattner <sabre@nondot.org>
Tue, 8 Sep 2009 01:22:54 +0000 (01:22 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 8 Sep 2009 01:22:54 +0000 (01:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81177 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index 5d1e8ec..846bf1e 100644 (file)
@@ -548,7 +548,9 @@ public:
       o << "DFSNumbers invalid: " << SlowQueries << " slow queries.";
     o << "\n";
 
-    PrintDomTree<NodeT>(getRootNode(), o, 1);
+    // The postdom tree can have a null root if there are no returns.
+    if (getRootNode())
+      PrintDomTree<NodeT>(getRootNode(), o, 1);
   }
 
 protected: