diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-09 22:35:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-09 22:35:03 +0000 |
commit | 16e5cb87baac018ca48d3cb80854f7a14228b063 (patch) | |
tree | 16a56653a4eaada26f84b2c889a1bb1792cb5b1c /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 0f2146bb5d59a407e111145bb1851f52450b8da2 (diff) | |
download | bcm5719-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.cpp | 3 |
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>>"; } |