Do not memcpy with same source and destination.

This can happen for sret_args. Drop the assignment in this case.
This commit is contained in:
kai
2013-05-10 12:59:14 +02:00
parent 251607a1df
commit 522c06ff7f
2 changed files with 4 additions and 1 deletions

View File

@@ -545,6 +545,8 @@ void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes, unsigned align)
{
assert (src != dst && "src and dst of memcpy must be different");
LLType* VoidPtrTy = getVoidPtrType();
dst = DtoBitCast(dst, VoidPtrTy);