On Mon, Feb 29, 2016 at 04:36:00PM +0800, Haojian Zhuang wrote: > 在 02/27/2016 04:42 AM, Leif Lindholm 写道: > >On Fri, Feb 26, 2016 at 05:34:50PM +0800, Haojian Zhuang wrote: > >>Since there's percentage calcution, multiply on 32bit variable > >>will cause overflow. So fix the variables as 64bit. > > > >So, this is not technically what it does - it changes the variables to > >be native integer size, meaning this does not fix anything on AArch32. > > > >Given that the existing code already populates one of these by calling > >AsciiStrHexToUint64, it would seem the correct fix would be to follow > >the commit message and actually change them to UINT64. > > mNumDataBytes = AsciiStrHexToUnit64 (NumBytesString); > Although AsciiStrHexToUnit64 () is used, the value is still stored as 32-bit > long. Since mNumDataBytes is declared as UINT32. > > I don't agree that it doesn't fix on AArch32. UINT64 is also supported > in AArch32. For example, unsigned long long int is 64-bit long on AArch32, > and we could do 64-bit calculation on AArch32.
Yes, UINT64 is also supported on AArch32 - but the patch turns the variables into UINTN, not UINT64. UINTN is 32-bit on AArch32. Regards, Leif _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel