Fix PR4975. Avoid referencing empty vector.

llvm-svn: 99840
This commit is contained in:
Evan Cheng 2010-03-29 21:27:30 +00:00
parent b355db7877
commit 742db6874a
2 changed files with 21 additions and 2 deletions

View File

@ -6051,8 +6051,10 @@ void SelectionDAGISel::LowerArguments(BasicBlock *LLVMBB) {
} }
if (!I->use_empty()) { if (!I->use_empty()) {
SDValue Res = DAG.getMergeValues(&ArgValues[0], NumValues, SDValue Res;
SDB->getCurDebugLoc()); if (!ArgValues.empty())
Res = DAG.getMergeValues(&ArgValues[0], NumValues,
SDB->getCurDebugLoc());
SDB->setValue(I, Res); SDB->setValue(I, Res);
// If this argument is live outside of the entry block, insert a copy from // If this argument is live outside of the entry block, insert a copy from

View File

@ -0,0 +1,17 @@
; RUN: llc < %s
; PR4975
%0 = type <{ [0 x i32] }>
%union.T0 = type { }
@.str = private constant [1 x i8] c" "
define arm_apcscc void @t(%0) nounwind {
entry:
%arg0 = alloca %union.T0
%1 = bitcast %union.T0* %arg0 to %0*
store %0 %0, %0* %1, align 1
ret void
}
declare arm_apcscc i32 @printf(i8*, ...)