From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 20CE481F3A for ; Wed, 16 Nov 2016 18:12:32 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 16 Nov 2016 18:12:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,651,1473145200"; d="scan'208";a="787399333" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 16 Nov 2016 18:12:36 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 16 Nov 2016 18:12:36 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Thu, 17 Nov 2016 10:12:09 +0800 From: "Gao, Liming" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: Ard Biesheuvel Thread-Topic: [Patch] MdePkg/BaseMemoryLib: Fix VS2015 build error Thread-Index: AQHSQHbaGuay5mL84EW3Lln2e5lsJqDcbwZQ Date: Thu, 17 Nov 2016 02:12:09 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4B4789@shsmsx102.ccr.corp.intel.com> References: <1479348225-15712-1-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1479348225-15712-1-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzExMzIxODQtYjMwMS00MjEwLTg2M2MtZGUwNzc2MDI5YTg4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjY2MjNoVjVSZ25pK1ZwRVFvOGRIRkJhUElONUt1XC9yQ0xocFI2V3Z2N0RZPSJ9 x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdePkg/BaseMemoryLib: Fix VS2015 build error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 02:12:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao -----Original Message----- From: Kinney, Michael D=20 Sent: Thursday, November 17, 2016 10:04 AM To: edk2-devel@lists.01.org Cc: Ard Biesheuvel ; Gao, Liming Subject: [Patch] MdePkg/BaseMemoryLib: Fix VS2015 build error https://bugzilla.tianocore.org/show_bug.cgi?id=3D237 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 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- MdePkg/Library/BaseMemoryLib/CopyMem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MdePkg/Library/BaseMemoryLib/CopyMem.c b/MdePkg/Library/BaseMe= moryLib/CopyMem.c index 6f4fd90..3db25ca 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. =20 - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.
Copyright (c) 2016, Linaro Ltd. All rights reserved.
=20 @@ -143,10 +143,10 @@ InternalMemCopyMem ( *(Destination8++) =3D *(Source8++); } } else if (SourceBuffer < DestinationBuffer) { - Destination8 =3D (UINT8*)DestinationBuffer + Length; - Source8 =3D (CONST UINT8*)SourceBuffer + Length; + Destination8 =3D (UINT8*)DestinationBuffer + (Length - 1); + Source8 =3D (CONST UINT8*)SourceBuffer + (Length - 1); while (Length-- !=3D 0) { - *(--Destination8) =3D *(--Source8); + *(Destination8--) =3D *(Source8--); } } } --=20 2.6.3.windows.1