diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2014-09-20 00:10:47 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-09-20 00:10:47 +0000 |
commit | 975726345cb4914152fd7d07d92d41dcfd921503 (patch) | |
tree | fb7b9a1240dd5cf2924e826f204b24445e1bebee /llvm/lib/CodeGen | |
parent | d780781b1f273b16eb0d1355a173180764e73fc6 (diff) | |
download | bcm5719-llvm-975726345cb4914152fd7d07d92d41dcfd921503.tar.gz bcm5719-llvm-975726345cb4914152fd7d07d92d41dcfd921503.zip |
Fix crash with an insertvalue that produces an empty object.
llvm-svn: 218171
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 6d302f98f55..6a8cd2eb3b1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -3307,6 +3307,12 @@ void SelectionDAGBuilder::visitInsertValue(const InsertValueInst &I) { unsigned NumValValues = ValValueVTs.size(); SmallVector<SDValue, 4> Values(NumAggValues); + // Ignore an insertvalue that produces an empty object + if (!NumAggValues) { + setValue(&I, DAG.getUNDEF(MVT(MVT::Other))); + return; + } + SDValue Agg = getValue(Op0); unsigned i = 0; // Copy the beginning value(s) from the original aggregate. |