From ffe335ace15373e34f7ca28a4b045c1d71f70a26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 14 Sep 2001 18:29:28 +0000 Subject: [PATCH] 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 --- lib/Target/SparcV9/SparcV9InstrSelection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index c73264c2210..fde7282e85a 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() -- 2.34.1