From 08addbd4770a60adb6dbdc29cf73e7720f08197a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 9 Sep 2005 22:35:03 +0000 Subject: [PATCH] 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 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index ae0c2c8d712..c27523ae131 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 "<>"; }