summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-08 01:44:02 +0000
committerDan Gohman <gohman@apple.com>2009-09-08 01:44:02 +0000
commitf4a0f0f03306f65c7a898621a40be9373fbe1bfb (patch)
tree42dd0ef34825f5780879500d7d47afdeb38e1c6c /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parentb2b0467e18a3bd4bfd22c6aeceb69139102428f8 (diff)
downloadbcm5719-llvm-f4a0f0f03306f65c7a898621a40be9373fbe1bfb.tar.gz
bcm5719-llvm-f4a0f0f03306f65c7a898621a40be9373fbe1bfb.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp4
1 files changed, 4 insertions, 0 deletions
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));
}
OpenPOWER on IntegriCloud