Reviewed-by: Liming Gao <liming....@intel.com>

Sorry for the missing. 

> -----Original Message-----
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, April 23, 2019 6:31 PM
> To: Feng, Bob C <bob.c.f...@intel.com>; Gao, Liming <liming....@intel.com>; 
> Zhu, Yonghong <yonghong....@intel.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>
> Subject: Re: [edk2-devel] [PATCH v2 3/5] BaseTools/PiFirmwareFile: fix 
> undefined behavior in SECTION_SIZE
> 
> Bob, Liming, Yonghong,
> 
> On 04/18/19 19:47, Laszlo Ersek wrote:
> > Sync SECTION_SIZE() from MdePkg to BaseTools, from an earlier patch in
> > this series.
> >
> > Cc: Bob Feng <bob.c.f...@intel.com>
> > Cc: Liming Gao <liming....@intel.com>
> > Cc: Yonghong Zhu <yonghong....@intel.com>
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
> > Signed-off-by: Laszlo Ersek <ler...@redhat.com>
> > ---
> >
> > Notes:
> >     v2:
> >
> >     - sync with the v2 MdePkg/PiFirmwareFile SECTION_SIZE patch
> >
> >  BaseTools/Source/C/Include/Common/PiFirmwareFile.h | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> can one of you please review this patch?
> 
> Thanks
> Laszlo
> 
> > diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h 
> > b/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
> > index 5bc871df4855..7d8acb669b69 100644
> > --- a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
> > +++ b/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
> > @@ -300,8 +300,15 @@ typedef struct {
> >    CHAR16                      VersionString[1];
> >  } EFI_VERSION_SECTION2;
> >
> > -#define SECTION_SIZE(SectionHeaderPtr) \
> > -    ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) 
> > SectionHeaderPtr)->Size) & 0x00ffffff))
> > +//
> > +// The argument passed as the SectionHeaderPtr parameter to the 
> > SECTION_SIZE()
> > +// function-like macro below must not have side effects: SectionHeaderPtr 
> > is
> > +// evaluated multiple times.
> > +//
> > +#define SECTION_SIZE(SectionHeaderPtr) ((UINT32) ( \
> > +    (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[0]      ) | \
> > +    (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[1] <<  8) | \
> > +    (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[2] << 16)))
> >
> >  #pragma pack()
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#39412): https://edk2.groups.io/g/devel/message/39412
Mute This Topic: https://groups.io/mt/31233851/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to