summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-18 11:33:26 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-18 11:33:26 +0000
commitfbe12b79aef4c2706e90078cc75b94dcf7926ba8 (patch)
tree3e008e770ede3205f66e38ceb9e3140f749712fd /MdeModulePkg/Core
parent6517edbe5156bdf40f4bbd46af001d10ef81c8ed (diff)
downloadedk2-platforms-fbe12b79aef4c2706e90078cc75b94dcf7926ba8.tar.xz
Refine code to make code run more safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10955 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/PiSmmCore/Pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c
index 928b6ed2cc..ea28484d68 100644
--- a/MdeModulePkg/Core/PiSmmCore/Pool.c
+++ b/MdeModulePkg/Core/PiSmmCore/Pool.c
@@ -185,7 +185,7 @@ InternalFreePoolByIndex (
ASSERT (((UINTN)FreePoolHdr & (FreePoolHdr->Header.Size - 1)) == 0);
ASSERT (FreePoolHdr->Header.Size >= MIN_POOL_SIZE);
- PoolIndex = HighBitSet32 ((UINT32)FreePoolHdr->Header.Size) - MIN_POOL_SHIFT;
+ PoolIndex = (UINTN) (HighBitSet32 ((UINT32)FreePoolHdr->Header.Size) - MIN_POOL_SHIFT);
FreePoolHdr->Header.Available = TRUE;
ASSERT (PoolIndex < MAX_POOL_INDEX);
InsertHeadList (&mSmmPoolLists[PoolIndex], &FreePoolHdr->Link);
@@ -240,7 +240,7 @@ SmmAllocatePool (
}
Size = (Size + MIN_POOL_SIZE - 1) >> MIN_POOL_SHIFT;
- PoolIndex = HighBitSet32 ((UINT32)Size);
+ PoolIndex = (UINTN) HighBitSet32 ((UINT32)Size);
if ((Size & (Size - 1)) != 0) {
PoolIndex++;
}