https://bugzilla.tianocore.org/show_bug.cgi?id=237
Make the smallest change possible to workaround a VS2015
build error. The change is to the loop that handles the
case where neither the source nor the destination are
64-bit or 32-bit aligned and the logic falls through to
a loop that performs the copy as bytes. Only the loop
that copies bytes backwards needs to be updated to avoid
the VS2015 build error.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
out into its own source file so that it can be excluded from a build for a\r
particular platform easily if an optimized version is desired.\r
\r
out into its own source file so that it can be excluded from a build for a\r
particular platform easily if an optimized version is desired.\r
\r
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.<BR>\r
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
\r
Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.<BR>\r
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
\r
*(Destination8++) = *(Source8++);\r
}\r
} else if (SourceBuffer < DestinationBuffer) {\r
*(Destination8++) = *(Source8++);\r
}\r
} else if (SourceBuffer < DestinationBuffer) {\r
- Destination8 = (UINT8*)DestinationBuffer + Length;\r
- Source8 = (CONST UINT8*)SourceBuffer + Length;\r
+ Destination8 = (UINT8*)DestinationBuffer + (Length - 1);\r
+ Source8 = (CONST UINT8*)SourceBuffer + (Length - 1);\r
while (Length-- != 0) {\r
while (Length-- != 0) {\r
- *(--Destination8) = *(--Source8);\r
+ *(Destination8--) = *(Source8--);\r