summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorMichael Kinney <michael.d.kinney@intel.com>2016-11-09 18:31:38 -0800
committerMichael Kinney <michael.d.kinney@intel.com>2016-11-17 09:43:23 -0800
commit5ea2bad0d9ab6a2465195badd323313553baa61b (patch)
treeec583384129f6f71f2a0898a8ba1c6a39cf6aa25 /MdePkg/Library
parent2048ab4b3ec966183eb87d93d9cdab05fe9cc840 (diff)
downloadedk2-5ea2bad0d9ab6a2465195badd323313553baa61b.tar.gz
edk2-5ea2bad0d9ab6a2465195badd323313553baa61b.tar.bz2
edk2-5ea2bad0d9ab6a2465195badd323313553baa61b.zip
MdePkg/BaseMemoryLib: Fix VS2015 build error
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>
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/BaseMemoryLib/CopyMem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/CopyMem.c b/MdePkg/Library/BaseMemoryLib/CopyMem.c
index 6f4fd900df..3db25ca851 100644
--- a/MdePkg/Library/BaseMemoryLib/CopyMem.c
+++ b/MdePkg/Library/BaseMemoryLib/CopyMem.c
@@ -3,7 +3,7 @@
out into its own source file so that it can be excluded from a build for a
particular platform easily if an optimized version is desired.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.<BR>
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
@@ -143,10 +143,10 @@ InternalMemCopyMem (
*(Destination8++) = *(Source8++);
}
} else if (SourceBuffer < DestinationBuffer) {
- Destination8 = (UINT8*)DestinationBuffer + Length;
- Source8 = (CONST UINT8*)SourceBuffer + Length;
+ Destination8 = (UINT8*)DestinationBuffer + (Length - 1);
+ Source8 = (CONST UINT8*)SourceBuffer + (Length - 1);
while (Length-- != 0) {
- *(--Destination8) = *(--Source8);
+ *(Destination8--) = *(Source8--);
}
}
}