Fix bug in va_copy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58680 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 0032cd3..98e70e8 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -66,7 +66,7 @@
}
case Builtin::BI__builtin_va_copy: {
// FIXME: This does not yet handle architectures where va_list is a struct.
- Value *DstPtr = EmitScalarExpr(E->getArg(0));
+ Value *DstPtr = EmitLValue(E->getArg(0)).getAddress();
Value *SrcValue = EmitScalarExpr(E->getArg(1));
Value *SrcPtr = CreateTempAlloca(SrcValue->getType(), "dst_ptr");