[edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined

Yonghong Zhu posted 4 patches 7 years, 4 months ago
There is a newer version of this series
[edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Posted by Yonghong Zhu 7 years, 4 months ago
Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
---
 DuetPkg/EfiLdr/TianoDecompress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/DuetPkg/EfiLdr/TianoDecompress.c b/DuetPkg/EfiLdr/TianoDecompress.c
index b504e8e..86d82fc 100644
--- a/DuetPkg/EfiLdr/TianoDecompress.c
+++ b/DuetPkg/EfiLdr/TianoDecompress.c
@@ -91,15 +91,15 @@ Arguments:
 
 Returns: (VOID)
 
 --*/
 {
-  Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
+  Sd->mBitBuf = (UINT32) (((UINT64)Sd->mBitBuf) << NumOfBits);
 
   while (NumOfBits > Sd->mBitCount) {
 
-    Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
+    Sd->mBitBuf |= (UINT32) (((UINT64)Sd->mSubBitBuf) << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
 
     if (Sd->mCompSize > 0) {
       //
       // Get 1 byte into SubBitBuf
       //
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Posted by Ni, Ruiyu 7 years, 4 months ago
I am surprised DuetPkg is still being used.

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Regards,
Ray

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
>Sent: Wednesday, August 2, 2017 5:28 PM
>To: edk2-devel@lists.01.org
>Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Andrew Fish <afish@apple.com>
>Subject: [edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
>
>Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635
>
>Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>Cc: Hao Wu <hao.a.wu@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Andrew Fish <afish@apple.com>
>---
> DuetPkg/EfiLdr/TianoDecompress.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/DuetPkg/EfiLdr/TianoDecompress.c b/DuetPkg/EfiLdr/TianoDecompress.c
>index b504e8e..86d82fc 100644
>--- a/DuetPkg/EfiLdr/TianoDecompress.c
>+++ b/DuetPkg/EfiLdr/TianoDecompress.c
>@@ -91,15 +91,15 @@ Arguments:
>
> Returns: (VOID)
>
> --*/
> {
>-  Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
>+  Sd->mBitBuf = (UINT32) (((UINT64)Sd->mBitBuf) << NumOfBits);
>
>   while (NumOfBits > Sd->mBitCount) {
>
>-    Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
>+    Sd->mBitBuf |= (UINT32) (((UINT64)Sd->mSubBitBuf) << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
>
>     if (Sd->mCompSize > 0) {
>       //
>       // Get 1 byte into SubBitBuf
>       //
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Posted by Richardson, Brian 7 years, 4 months ago
I thought we considered this an obsolete package.
https://github.com/tianocore/tianocore.github.io/wiki/DuetPkg 

If this package is obsolete, the readme needs to be updated to reflect this information.
https://github.com/tianocore/edk2/tree/master/DuetPkg 

Thanks ... br
---
Brian Richardson, Senior Technical Marketing Engineer, Intel Software
brian.richardson@intel.com -- @intel_brian (Twitter & WeChat)
https://software.intel.com/en-us/meet-the-developers/evangelists/team/brian-richardson 

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ni, Ruiyu
Sent: Wednesday, August 2, 2017 9:42 PM
To: Zhu, Yonghong <yonghong.zhu@intel.com>; edk2-devel@lists.01.org
Cc: Wu, Hao A <hao.a.wu@intel.com>; Andrew Fish <afish@apple.com>
Subject: Re: [edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined

I am surprised DuetPkg is still being used.

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Regards,
Ray

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
>Sent: Wednesday, August 2, 2017 5:28 PM
>To: edk2-devel@lists.01.org
>Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Andrew Fish <afish@apple.com>
>Subject: [edk2] [Patch 2/4] DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
>
>Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635
>
>Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>Cc: Hao Wu <hao.a.wu@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Andrew Fish <afish@apple.com>
>---
> DuetPkg/EfiLdr/TianoDecompress.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/DuetPkg/EfiLdr/TianoDecompress.c b/DuetPkg/EfiLdr/TianoDecompress.c
>index b504e8e..86d82fc 100644
>--- a/DuetPkg/EfiLdr/TianoDecompress.c
>+++ b/DuetPkg/EfiLdr/TianoDecompress.c
>@@ -91,15 +91,15 @@ Arguments:
>
> Returns: (VOID)
>
> --*/
> {
>-  Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
>+  Sd->mBitBuf = (UINT32) (((UINT64)Sd->mBitBuf) << NumOfBits);
>
>   while (NumOfBits > Sd->mBitCount) {
>
>-    Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
>+    Sd->mBitBuf |= (UINT32) (((UINT64)Sd->mSubBitBuf) << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
>
>     if (Sd->mCompSize > 0) {
>       //
>       // Get 1 byte into SubBitBuf
>       //
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel