MdeModulePkg/Core: fix bits operation error on a boundary condition
authorJian J Wang <jian.j.wang@intel.com>
Thu, 15 Mar 2018 04:45:43 +0000 (12:45 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 16 Mar 2018 07:01:12 +0000 (15:01 +0800)
commit36f2f049a83d82f7c0c847202c9ce2974492c1ab
treee543b56369bf88eebc988685439c6fda82729437
parent883787a2c6f83a59fa56f9529317aa86be71fe91
MdeModulePkg/Core: fix bits operation error on a boundary condition

If given address is on 64K boundary and the requested bit number is 64,
all SetBits(), ClearBits() and GetBits() will encounter ASSERT problem
in trying to do a 64 bits of shift, which is not allowed by LShift() and
RShift(). This patch tries to fix this issue by turning bits operation
into whole integer operation in such situation.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdeModulePkg/Core/Dxe/Mem/HeapGuard.c