POSIX: fix possible API misuse

memcpy cannot be passed NULL.  Ensuring that the destination pointer is non-NULL
requires checking success.  Rather than performing the success check at that
point, increasing indentation an additional level, fold it into the previous
statement.

llvm-svn: 203359
This commit is contained in:
Saleem Abdulrasool 2014-03-08 20:47:12 +00:00
parent d41fca11af
commit 9174593d09
1 changed files with 5 additions and 5 deletions

View File

@ -347,12 +347,12 @@ RegisterContextPOSIXProcessMonitor_x86_64::ReadAllRegisterValues(DataBufferSP &d
if (success)
{
::memcpy (dst, &m_gpr_x86_64, GetGPRSize());
dst += GetGPRSize();
::memcpy (dst, &m_gpr_x86_64, GetGPRSize());
dst += GetGPRSize();
if (GetFPRType() == eFXSAVE)
::memcpy (dst, &m_fpr.xstate.fxsave, sizeof(m_fpr.xstate.fxsave));
}
if (GetFPRType() == eFXSAVE)
::memcpy (dst, &m_fpr.xstate.fxsave, sizeof(m_fpr.xstate.fxsave));
if (GetFPRType() == eXSAVE)
{
ByteOrder byte_order = GetByteOrder();