Prevent a segfault for vaarg expressions on unsupported architectures.

llvm-svn: 62008
This commit is contained in:
Sebastian Redl 2009-01-09 21:09:38 +00:00
parent 519976c4e9
commit 020cddcfee
1 changed files with 4 additions and 2 deletions

View File

@ -278,9 +278,11 @@ void AggExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
llvm::Value *ArgValue = CGF.EmitLValue(VE->getSubExpr()).getAddress();
llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, VE->getType());
if (!ArgPtr)
if (!ArgPtr) {
CGF.ErrorUnsupported(VE, "aggregate va_arg expression");
return;
}
if (DestPtr)
// FIXME: volatility
CGF.EmitAggregateCopy(DestPtr, ArgPtr, VE->getType());