aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-14 18:29:28 +0000
committerChris Lattner <sabre@nondot.org>2001-09-14 18:29:28 +0000
commitffe335ace15373e34f7ca28a4b045c1d71f70a26 (patch)
treee3e4a46bac9c172275c2d549e777daad90c64e35
parentc0c77083ba7915fabbe86065a77f2b7bb5636bef (diff)
Fix a bug that caused a crash if a setcc had zero uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@574 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index c73264c221..fde7282e85 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -1688,7 +1688,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
// to follow SSA def-use edges here, not BURG tree edges.
//
Instruction* result = subtreeRoot->getInstruction();
- Value* firstUse = (Value*) * result->use_begin();
+ Value* firstUse = result->use_empty() ? 0 : *result->use_begin();
bool discardResult =
(result->use_size() == 1
&& firstUse->isInstruction()