mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Fix crash with an insertvalue that produces an empty object.
llvm-svn: 218171
This commit is contained in:
parent
c5140ae96c
commit
203d8801c7
@ -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.
|
||||
|
7
test/CodeGen/Generic/empty-insertvalue.ll
Normal file
7
test/CodeGen/Generic/empty-insertvalue.ll
Normal file
@ -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
Block a user