From 597f81fea26716ea024072bc154395d773b08567 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Sep 2002 20:27:10 +0000 Subject: [PATCH] Fix a bug I introduced into the code generator. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3694 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 2 +- lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index 036b1a7f3f2..c651f016fe0 100644 --- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -114,7 +114,7 @@ FoldGetElemChain(InstrTreeNode* ptrNode, vector& chainIdxVec) { InstructionNode* gepNode = dyn_cast(ptrNode); GetElementPtrInst* gepInst = - dyn_cast_or_null(gepNode->getInstruction()); + dyn_cast_or_null(gepNode ? gepNode->getInstruction() :0); // ptr value is not computed in this tree or ptr value does not come from GEP // instruction diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp index 036b1a7f3f2..c651f016fe0 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp @@ -114,7 +114,7 @@ FoldGetElemChain(InstrTreeNode* ptrNode, vector& chainIdxVec) { InstructionNode* gepNode = dyn_cast(ptrNode); GetElementPtrInst* gepInst = - dyn_cast_or_null(gepNode->getInstruction()); + dyn_cast_or_null(gepNode ? gepNode->getInstruction() :0); // ptr value is not computed in this tree or ptr value does not come from GEP // instruction