Fix a bug I introduced into the code generator. :(
llvm-svn: 3694
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
index 036b1a7..c651f01 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
@@ -114,7 +114,7 @@
{
InstructionNode* gepNode = dyn_cast<InstructionNode>(ptrNode);
GetElementPtrInst* gepInst =
- dyn_cast_or_null<GetElementPtrInst>(gepNode->getInstruction());
+ dyn_cast_or_null<GetElementPtrInst>(gepNode ? gepNode->getInstruction() :0);
// ptr value is not computed in this tree or ptr value does not come from GEP
// instruction