diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-08 01:44:02 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-08 01:44:02 +0000 |
commit | ed48caf5e703c8ee088a8ffa7fb77ebd1b25e97b (patch) | |
tree | f1cedae0fd81a566765a26bb3f008f2ad8e76496 /lib/CodeGen/SelectionDAG | |
parent | 49072473bac39f888be9e3814de48215daacea46 (diff) | |
download | external_llvm-ed48caf5e703c8ee088a8ffa7fb77ebd1b25e97b.zip external_llvm-ed48caf5e703c8ee088a8ffa7fb77ebd1b25e97b.tar.gz external_llvm-ed48caf5e703c8ee088a8ffa7fb77ebd1b25e97b.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index ce412e0..ad59912 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/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)); } |