diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-21 20:07:30 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-21 20:07:30 +0000 |
commit | 639cdc210b86302bfa03e2a88266ef0d4aba102c (patch) | |
tree | add5ee91a172047dfcd8cd50b2b225f1c058f435 | |
parent | 0416b0a26d6fe7b1a8b7b8987164d0fd398bbee1 (diff) |
Fix an out-of-bounds access in -view-sunit-dags in the case of an
empty ScheduleDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50054 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index b07b86eb94..904638d4f7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -301,7 +301,8 @@ namespace llvm { static void addCustomGraphFeatures(ScheduleDAG *G, GraphWriter<ScheduleDAG*> &GW) { GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot"); - if (G->DAG.getRoot().Val) + if (G->DAG.getRoot().Val && + G->SUnitMap.find(G->DAG.getRoot().Val) != G->SUnitMap.end()) GW.emitEdge(0, -1, G->SUnitMap[G->DAG.getRoot().Val].front(), -1, ""); } }; |