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 | 08addbd4770a60adb6dbdc29cf73e7720f08197a (patch) | |
tree | 0414e79a8c67cef2482f338a8f9e6e9d6e5c789d /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | c9fe7508a5e072479d4ab5711c60aa5142c64f10 (diff) |
Fix a crash viewing dags that have target nodes in them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index ae0c2c8d71..c27523ae13 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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>>"; } |