From f4a0f0f03306f65c7a898621a40be9373fbe1bfb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 8 Sep 2009 01:44:02 +0000 Subject: Fix an abort on a store of an empty struct member. getValue returns null in the case of an empty struct, so don't try to call getNumValues on it. llvm-svn: 81180 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index ce412e01c0e..ad599124fb8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -861,6 +861,10 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { for (User::const_op_iterator OI = C->op_begin(), OE = C->op_end(); OI != OE; ++OI) { SDNode *Val = getValue(*OI).getNode(); + // If the operand is an empty aggregate, there are no values. + if (!Val) continue; + // Add each leaf value from the operand to the Constants list + // to form a flattened list of all the values. for (unsigned i = 0, e = Val->getNumValues(); i != e; ++i) Constants.push_back(SDValue(Val, i)); } -- cgit v1.2.3