From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.17502.1616994686040875578 for ; Sun, 28 Mar 2021 22:11:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 29 Mar 2021 13:11:20 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , References: In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBCYXNlVG9vbHMvR2VuRnc6IEZpeCBjYXN0aW5nIHJlc3VsdCBvZiBjb21wYXJpc29u?= Date: Mon, 29 Mar 2021 13:11:22 +0800 Message-ID: <002a01d72459$f637cba0$e2a762e0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJk/5Ai4w5TLpSZXYtjdMw3+DOZ7Kl+tFuQ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Tim: This change is good. Reviewed-by: Liming Gao Besides, which compiler detects this issue? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io = =B4=FA=B1=ED Tim Crawford > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA3=D4=C226=C8=D5 8:48 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =D6=F7=CC=E2: [edk2-devel] [PATCH] BaseTools/GenFw: Fix casting result = of > comparison >=20 > The cast in IsDataShdr() is only applied the left side, causing it to > always return FALSE. >=20 > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3271 > Signed-off-by: Tim Crawford > --- > BaseTools/Source/C/GenFw/Elf32Convert.c | 2 +- > BaseTools/Source/C/GenFw/Elf64Convert.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c > b/BaseTools/Source/C/GenFw/Elf32Convert.c > index 7f351287a9..df54991768 100644 > --- a/BaseTools/Source/C/GenFw/Elf32Convert.c > +++ b/BaseTools/Source/C/GenFw/Elf32Convert.c > @@ -262,7 +262,7 @@ IsDataShdr ( > if (IsHiiRsrcShdr(Shdr)) { >=20 > return FALSE; >=20 > } >=20 > - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D > (SHF_ALLOC | SHF_WRITE); >=20 > + return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D > (SHF_ALLOC | SHF_WRITE)); >=20 > } >=20 >=20 >=20 > STATIC >=20 > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c > b/BaseTools/Source/C/GenFw/Elf64Convert.c > index 4ed6b4477e..1bf1e9accb 100644 > --- a/BaseTools/Source/C/GenFw/Elf64Convert.c > +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c > @@ -270,7 +270,7 @@ IsDataShdr ( > if (IsHiiRsrcShdr(Shdr)) { >=20 > return FALSE; >=20 > } >=20 > - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D > (SHF_ALLOC | SHF_WRITE); >=20 > + return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D=3D > (SHF_ALLOC | SHF_WRITE)); >=20 > } >=20 >=20 >=20 > STATIC >=20 > -- > 2.30.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#73394): = https://edk2.groups.io/g/devel/message/73394 > Mute This Topic: https://groups.io/mt/81630142/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20