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 | dc90919d2b0160bb0ceadffae96ae857276a4999 (patch) | |
tree | 828d91e499fa227b55256f1c1010b5670e9c93f8 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | |
parent | db08f5218e9565e1d022480b445d32b204638440 (diff) | |
download | bcm5719-llvm-dc90919d2b0160bb0ceadffae96ae857276a4999.tar.gz bcm5719-llvm-dc90919d2b0160bb0ceadffae96ae857276a4999.zip |
Fix an out-of-bounds access in -view-sunit-dags in the case of an
empty ScheduleDAG.
llvm-svn: 50054
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index b07b86eb949..904638d4f7a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/llvm/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, ""); } }; |