Fix a bug I introduced into the code generator. :(
authorChris Lattner <sabre@nondot.org>
Thu, 12 Sep 2002 20:27:10 +0000 (20:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 12 Sep 2002 20:27:10 +0000 (20:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3694 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp

index 036b1a7f3f2c9b156b92295f71916c2a346be919..c651f016fe0fb84ea3f7b3dd3ecfdfded4b9929b 100644 (file)
@@ -114,7 +114,7 @@ FoldGetElemChain(InstrTreeNode* ptrNode, vector<Value*>& chainIdxVec)
 {
   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
index 036b1a7f3f2c9b156b92295f71916c2a346be919..c651f016fe0fb84ea3f7b3dd3ecfdfded4b9929b 100644 (file)
@@ -114,7 +114,7 @@ FoldGetElemChain(InstrTreeNode* ptrNode, vector<Value*>& chainIdxVec)
 {
   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