forked from OSchip/llvm-project
Fix crash with an insertvalue that produces an empty object.
llvm-svn: 218171
This commit is contained in:
parent
d780781b1f
commit
975726345c
|
@ -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.
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
; RUN: llc < %s
|
||||
|
||||
define void @f() {
|
||||
entry:
|
||||
%0 = insertvalue { [0 x { i8*, i8* }], [0 x { i8*, i64 }] } undef, [0 x { i8*, i8* }] undef, 0
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue