summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-09 22:35:03 +0000
committerChris Lattner <sabre@nondot.org>2005-09-09 22:35:03 +0000
commit16e5cb87baac018ca48d3cb80854f7a14228b063 (patch)
tree16a56653a4eaada26f84b2c889a1bb1792cb5b1c /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent0f2146bb5d59a407e111145bb1851f52450b8da2 (diff)
downloadbcm5719-llvm-16e5cb87baac018ca48d3cb80854f7a14228b063.tar.gz
bcm5719-llvm-16e5cb87baac018ca48d3cb80854f7a14228b063.zip
Fix a crash viewing dags that have target nodes in them
llvm-svn: 23300
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ae0c2c8d712..c27523ae131 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2263,7 +2263,8 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
else {
if (G)
if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo())
- return TII->getName(getOpcode()-ISD::BUILTIN_OP_END);
+ if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes())
+ return TII->getName(getOpcode()-ISD::BUILTIN_OP_END);
return "<<Unknown Target Node>>";
}
OpenPOWER on IntegriCloud